From c1af29f641ff439a7422b714ad9ad2d7e2d06509 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 25 Nov 2018 01:57:05 -0800 Subject: [PATCH] __fish_config_interactive: tell complete that [ wraps test We want to show our completions for the `[` (`test`) builtin, but we don't want to create a [.fish. --- share/completions/test.fish | 4 ---- share/functions/__fish_config_interactive.fish | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/share/completions/test.fish b/share/completions/test.fish index a240650af..e7e260034 100644 --- a/share/completions/test.fish +++ b/share/completions/test.fish @@ -1,6 +1,3 @@ -complete -c [ --wraps test -#complete -c test -l help -d "Display help and exit" -#complete -c test -l version -d "Display version and exit" complete -c test -f -a ! -d "Negate expression" complete -c test -f -s a -d "Logical AND" complete -c test -f -s o -d "Logical OR" @@ -35,4 +32,3 @@ complete -c test -f -s t -d "FD is a terminal" complete -c test -s u -d "File set-user-ID bit is set" complete -c test -s w -d "File is writable" complete -c test -s x -d "File is executable" - diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 56ce69cfd..209cdd1ca 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -186,6 +186,12 @@ function __fish_config_interactive -d "Initializations that should be performed complete -x -p "/etc/init.d/*" -a reload --description 'Reload service configuration' end + # + # We want to show our completions for the [ (test) builtin, but + # we don't want to create a [.fish. test.fish will not be loaded until + # the user tries [ interactively. + # + complete -c [ --wraps test # Reload key bindings when binding variable change function __fish_reload_key_bindings -d "Reload key bindings when binding variable change" --on-variable fish_key_bindings