Fix __fish_complete_suffix behavior per __fish_complete_directories test

This commit is contained in:
Mahmoud Al-Qudsi 2018-05-20 14:35:51 -05:00
parent 0a337a9d8e
commit 7d33372d20
2 changed files with 8 additions and 5 deletions

View file

@ -69,7 +69,10 @@ function __fish_complete_suffix -d "Complete using files"
# term a "bug" per-se. # term a "bug" per-se.
if test $files[1] if test $files[1]
printf "%s\t$desc\n" $files | sort -u if not string match -q -- "$desc" ""
set -l desc "\t$desc"
end
printf "%s$desc\n" $files | sort -u
end end
end end

View file

@ -1,10 +1,10 @@
cd .. cd ..
mkdir test/data/abc mkdir -p test/data/abc
mkdir test/data/abcd mkdir -p test/data/abcd
touch test/data/af touch test/data/af
touch test/data/abcdf touch test/data/abcdf
mkdir test/data/xy mkdir -p test/data/xy
mkdir test/data/xyz mkdir -p test/data/xyz
touch test/data/xyf touch test/data/xyf
touch test/data/xyzf touch test/data/xyzf
echo \# __fish_complete_directories test/z echo \# __fish_complete_directories test/z