mirror of
https://github.com/iridakos/goto.git
synced 2025-05-18 00:10:13 -07:00
Fallback for compopt in macOS.
This commit is contained in:
parent
55afbbc10e
commit
967cf1852d
@ -207,14 +207,14 @@ function _complete_goto_aliases()
|
||||
|
||||
if [ "${#matches[@]}" -eq "1" ]; then
|
||||
# remove the filenames attribute from the completion method
|
||||
compopt +o filenames
|
||||
compopt +o filenames 2>/dev/null
|
||||
|
||||
# if you find only one alias don't append the directory
|
||||
COMPREPLY=$(printf ${matches[0]} | sed 's/[\t ].*//')
|
||||
else
|
||||
for i in "${!matches[@]}"; do
|
||||
# remove the filenames attribute from the completion method
|
||||
compopt +o filenames
|
||||
compopt +o filenames 2>/dev/null
|
||||
|
||||
matches[$i]="$(echo ${matches[$i]} | sed 's/[\t]/ /g')"
|
||||
matches[$i]=$(printf '%*s' "-$COLUMNS" "${matches[$i]}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user