Differentiate alias completion for Darwin.

Refs #1.
This commit is contained in:
Lazarus Lazaridis 2018-03-05 22:43:43 +02:00
parent 8a6fc50212
commit d1e7c194e9

View File

@ -216,10 +216,16 @@ function _complete_goto_aliases()
# remove the filenames attribute from the completion method # remove the filenames attribute from the completion method
compopt +o filenames 2>/dev/null compopt +o filenames 2>/dev/null
matches[$i]="$(echo ${matches[$i]} | sed 's/[\t]/ /g')" if ! [[ $(uname -s) =~ Darwin* ]]; then
matches[$i]=$(printf '%*s' "-$COLUMNS" "${matches[$i]}") matches[$i]="$(echo ${matches[$i]} | sed 's/[\t]/ /g')"
matches[$i]=$(printf '%*s' "-$COLUMNS" "${matches[$i]}")
COMPREPLY+=($(compgen -W "${matches[$i]}")) COMPREPLY+=($(compgen -W "${matches[$i]}"))
else
al=$(echo ${matches[$i]} | sed 's/[\t ].*//')
COMPREPLY+=($(compgen -W "$al"))
fi
done done
fi fi
} }