From e5010d76b593dda9d2ffe9e1ccdfb767ceaf21b4 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 27 Sep 2022 01:16:19 +0200 Subject: [PATCH] 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. --- .config/zsh/autoload/ls-show-hidden | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/autoload/ls-show-hidden b/.config/zsh/autoload/ls-show-hidden index 397eb97..9275d02 100755 --- a/.config/zsh/autoload/ls-show-hidden +++ b/.config/zsh/autoload/ls-show-hidden @@ -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"