Fix __fish_complete_directories test failure

The `sort -u` was applied only conditionally in __fish_complete_suffix,
now applied universally at the final step.
This commit is contained in:
Mahmoud Al-Qudsi 2018-05-20 13:50:28 -05:00
parent 4be4932786
commit fd4b3f2c26

View file

@ -60,15 +60,16 @@ function __fish_complete_suffix -d "Complete using files"
if string match -qr '[${}*~]' $comp if string match -qr '[${}*~]' $comp
set -l expanded set -l expanded
eval "set expanded $comp" eval "set expanded $comp"
# It's very unfortunate to do all this work in-process and have to shell out here, set files (string replace -- $expanded $comp $files)
# but unfortunately at this time expressions like "foo{t,te}*" applied against
# "footer" will result in "footer" being reported twice. Not sure if this can be
# term a "bug" per-se.
set files (string replace -- $expanded $comp $files | sort -u)
end end
# It's very unfortunate to do all this work in-process and have to shell out here,
# but unfortunately at this time expressions like "foo{t,te}*" applied against
# "footer" will result in "footer" being reported twice. Not sure if this can be
# term a "bug" per-se.
if test $files[1] if test $files[1]
printf "%s\t$desc\n" $files printf "%s\t$desc\n" $files | sort -u
end end
end end