mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Fix "set fish_complete_path" accidentally disabling autoloading
Commit 5918bca1eb (Make "complete -e" prevent completion autoloading,
2024-08-24) makes "complete -e foo" add a tombstone for "foo", meaning we
will never again load completions for "foo".
Due to an oversight, the same tombstone is added when we clear cached
completions after changing "fish_complete_path", preventing completions from
being loaded in that case. Fix this by restoring the old behavior unless
the user actually used "complete -e".
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
#RUN: %fish %s
|
||||
|
||||
set -g fish_complete_path c1 c2
|
||||
mkdir c1 c2
|
||||
|
||||
function foo; end
|
||||
mkdir $__fish_config_dir/completions
|
||||
echo >$__fish_config_dir/completions/foo.fish "echo auto-loading foo.fish"
|
||||
for i in c1 c2
|
||||
echo >$i/foo.fish "echo auto-loading $i/foo.fish"
|
||||
end
|
||||
complete -C "foo " >/dev/null
|
||||
# CHECK: auto-loading foo.fish
|
||||
# CHECK: auto-loading c1/foo.fish
|
||||
complete -C "foo " >/dev/null
|
||||
# already loaded
|
||||
|
||||
set -g fish_complete_path c2
|
||||
complete -C "foo " >/dev/null
|
||||
# CHECK: auto-loading c2/foo.fish
|
||||
|
||||
set -g fish_complete_path c1 c2
|
||||
complete -C "foo " >/dev/null
|
||||
# CHECK: auto-loading c1/foo.fish
|
||||
|
||||
Reference in New Issue
Block a user