summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Base/_math2
-rw-r--r--Completion/Base/_subscript14
3 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 16844bafe..01f4d59b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2000-10-10  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 12946: Completion/Base/_math, Completion/Base/_subscript,
+ 	Completion/Builtins/_vars, Completion/Builtins/_zstyle,
+ 	Completion/Core/_parameters, Doc/Zsh/compsys.yo: add
+ 	fake-parameters style to allow completing parameters which are not
+ 	yet set
+	
 	* 12942,12945: Completion/Core/_expand: temporarily remove global
  	aliases to avoid error message inside the evals
 	
diff --git a/Completion/Base/_math b/Completion/Base/_math
index 61c991e3c..278189ebe 100644
--- a/Completion/Base/_math
+++ b/Completion/Base/_math
@@ -9,4 +9,4 @@ if [[ "$SUFFIX" = *[^a-zA-Z0-9_]* ]]; then
   SUFFIX="${SUFFIX%%[^a-zA-Z0-9_]*}"
 fi
 
-_parameters -g '(integer|float)*'
+_parameters -g '(integer|float)*' || _parameters
diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript
index e3bde552a..9a6801352 100644
--- a/Completion/Base/_subscript
+++ b/Completion/Base/_subscript
@@ -1,6 +1,12 @@
 #compdef -subscript-
 
-local expl
+local expl osuf=']'
+
+if [[ "$1" = -q ]]; then
+  osuf='] '
+  compquote osuf
+  shift
+fi
 
 if [[ "$PREFIX" = :* ]]; then
   _wanted characters expl 'character class' \
@@ -9,7 +15,7 @@ if [[ "$PREFIX" = :* ]]; then
 elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
   local suf
 
-  [[ "$RBUFFER" != \]* ]] && suf=']'
+  [[ "$RBUFFER" != (|\\)\]* ]] && suf="$osuf"
 
   _wanted association-keys expl 'association key' \
       compadd -S "$suf" -k "$compstate[parameter]"
@@ -37,12 +43,12 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
         disp=()
       fi
 
-      if [[ "$RBUFFER" = \]* ]]; then
+      if [[ "$RBUFFER" = (|\\)\]* ]]; then
         _all_labels -V indexes expl 'array index' \
             compadd -S '' "$disp[@]" -a ind && ret=0
       else
         _all_labels -V indexes expl 'array index' \
-            compadd -S ']' "$disp[@]" -a ind && ret=0
+            compadd -S "$osuf" "$disp[@]" -a ind && ret=0
       fi
     fi
     _requested parameters && _parameters && ret=0