zsh:ls-show-hidden: Correct print format

When an argument is passed that does not exist, `ls` always prints the
directory name for the existing ones, even if there is only one
remaining directory that is listed.
This commit is contained in:
2022-09-27 01:16:19 +02:00
parent 82fc29f9c0
commit e5010d76b5

View File

@@ -90,7 +90,7 @@ for dir in ${(@f)dirs}; do
fi
# If there are multiple items to list, print a newline (if ls was already
# executed) followed by the dir-name.
! (( ${#dirs} + ${#files} - 1 )) || echo "$separator$dir:"
! (( ${#dirs} + ${#files} + ${non_existing} - 1 )) || echo "$separator$dir:"
# Print directory. $all_flag has to be unquoted else ls will fail.
command $LS_COMMAND "$@" $all_flag -- "$dir"
separator="\n"