From fd4b3f2c262de2ce47b6b0091058c96dfe8888cc Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 20 May 2018 13:50:28 -0500 Subject: [PATCH] Fix __fish_complete_directories test failure The `sort -u` was applied only conditionally in __fish_complete_suffix, now applied universally at the final step. --- share/functions/__fish_complete_suffix.fish | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/share/functions/__fish_complete_suffix.fish b/share/functions/__fish_complete_suffix.fish index 413ef665d..2b28f29ab 100644 --- a/share/functions/__fish_complete_suffix.fish +++ b/share/functions/__fish_complete_suffix.fish @@ -60,15 +60,16 @@ function __fish_complete_suffix -d "Complete using files" if string match -qr '[${}*~]' $comp set -l expanded eval "set expanded $comp" - # 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. - set files (string replace -- $expanded $comp $files | sort -u) + set files (string replace -- $expanded $comp $files) 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] - printf "%s\t$desc\n" $files + printf "%s\t$desc\n" $files | sort -u end end