diff --git a/share/functions/__fish_complete_mime.fish b/share/functions/__fish_complete_mime.fish index cd84da1f5..3639d31e6 100644 --- a/share/functions/__fish_complete_mime.fish +++ b/share/functions/__fish_complete_mime.fish @@ -14,14 +14,14 @@ function __fish_complete_mime -d "Complete using text files" set desc (mimedb -d $files) # Format completions and descriptions - set -l res - for i in (seq (count $files)) - set res $res $files[$i]\t$desc[$i] - end + if count $files > /dev/null + set -l res + for i in (seq (count $files)) + set res $res $files[$i]\t$desc[$i] + end - if test $res[1] - printf "%s\n" $res + if test $res[1] + printf "%s\n" $res + end end - end -