From 2540b917c328725e2d12a78d765f58e58b747bef Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Mon, 28 Sep 2020 03:23:11 +0200 Subject: [PATCH] zsh:autoload:ls: Fix behavior when -d is given --- .config/zsh/autoload/ls | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/zsh/autoload/ls b/.config/zsh/autoload/ls index 79354d9..e7312a9 100755 --- a/.config/zsh/autoload/ls +++ b/.config/zsh/autoload/ls @@ -34,6 +34,14 @@ if ! (( ${#dirs} + ${#files} )); then dirs+="$PWD" fi +# Do not separate files and directories if -d flag was specified. +while getopts d flag 2>/dev/null; do + if [ "$flag" = "d" ]; then + command ls "$@" -- "${files[@]}" "${dirs[@]}" + return + fi +done + builtin local separator="" # Print files.