Clarify that some complete calls just need a command with no user-defined completion

This commit is contained in:
Johannes Altmanninger
2020-10-02 05:48:55 +02:00
parent fb57ca8791
commit 1173e8bda4
2 changed files with 3 additions and 4 deletions

View File

@@ -51,9 +51,8 @@ function __fish_complete_suffix -d "Complete using files"
# Simple and common case: no prefix, just complete normally and filter out unwanted suffixes.
if test -z $prefix
set -l suffix (string escape --style=regex -- $suff)
# Use normal file completions. Any valid command works here as, as long as it has no
# user-defined completions. The builtin ":" should work.
set files (complete -C ": $comp" | string match -r "^.*(?:$suffix|/)\$")
# Use normal file completions.
set files (complete -C "__fish_command_without_completions $comp" | string match -r "^.*(?:$suffix|/)\$")
else
# Strip leading ./ as it confuses the detection of base and suffix
# It is conditionally re-added below.