about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/_brace_parameter2
-rw-r--r--Completion/Base/_long_options9
-rw-r--r--Completion/Base/_subscript13
-rw-r--r--Completion/Base/_vars2
4 files changed, 13 insertions, 13 deletions
diff --git a/Completion/Base/_brace_parameter b/Completion/Base/_brace_parameter
index 092376e78..3fab8510a 100644
--- a/Completion/Base/_brace_parameter
+++ b/Completion/Base/_brace_parameter
@@ -2,4 +2,4 @@
 
 # Simple but without spiffy suffix handling: compgen -v -S '} '
 
-compadd -S '} ' -r '-:?#%+=[/'  - "${(@)${${${(f)$(typeset)}%%\=*}##* }:gs/'//}"
+compadd -S '} ' -r '-:?#%+=[/'  - "${(@)${(@)${(@f)$(set)}%%\=*}:gs/'//}"
diff --git a/Completion/Base/_long_options b/Completion/Base/_long_options
index a5d92632c..cc3175592 100644
--- a/Completion/Base/_long_options
+++ b/Completion/Base/_long_options
@@ -2,9 +2,12 @@
 
 # This function tries to automatically complete long option names. For 
 # this it invokes the command from the line with the `--help' option
-# and then parses the output to find possible option names. For
-# options that get an argument after a `=', the function also tries to 
-# automatically find out what should be complete as the argument.
+# and then parses the output to find possible option names, so you
+# should be careful to make sure that this function is not called for
+# a command that does not support this option.
+#
+# For options that get an argument after a `=', the function also tries
+# to automatically find out what should be complete as the argument.
 # The possible completions for option-arguments can be described with
 # the arguments to this function. This is done by giving pairs of
 # patterns and actions as consecutive arguments. The actions specify
diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript
index 670739a9a..e783d04e7 100644
--- a/Completion/Base/_subscript
+++ b/Completion/Base/_subscript
@@ -1,10 +1,7 @@
 #defcomp -subscript-
 
-local ret=1
-
-_compalso -math- && ret=0
-
-[[ ${(Pt)${compstate[parameter]}} = assoc* ]] &&
-  compgen -k "( ${(kP)${compstate[parameter]}} )" && ret=0
-
-return ret
+if [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
+  compgen -S ']' -k "( ${(kP)${compstate[parameter]}} )"
+else
+  _compalso -math-
+fi
diff --git a/Completion/Base/_vars b/Completion/Base/_vars
index 92de51e1f..497a9316f 100644
--- a/Completion/Base/_vars
+++ b/Completion/Base/_vars
@@ -1,3 +1,3 @@
-#defcomp -math- getopts read unset vared
+#defcomp getopts read unset vared
 
 compgen -v