about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-09 11:25:35 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-09 11:25:35 +0000
commit367148fdbe48464ddfd7114a21c0e4c7840c4dfe (patch)
tree1cc4380c9460dc0bc58287864eb7d419ea3f49ac
parenta81c33682a8409790b538cbb9e9edb240220615b (diff)
downloadzsh-367148fdbe48464ddfd7114a21c0e4c7840c4dfe.tar.gz
zsh-367148fdbe48464ddfd7114a21c0e4c7840c4dfe.tar.xz
zsh-367148fdbe48464ddfd7114a21c0e4c7840c4dfe.zip
24804: fix quoting of assoc array subscripts in completion
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Zsh/Context/_subscript6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 32e72a3fb..990f8214a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-09  Peter Stephenson  <pws@csr.com>
+
+	* 24804: Completion/Zsh/Context/_subscript: quoting of
+	associative array keys for subscripts was wrong.
+
 2008-04-07  Clint Adams  <clint@zsh.org>
 
 	* Markus Waldeck: 24799: Completion/Unix/Command/_vorbis:
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 7d01565ca..ba398ffa5 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -67,12 +67,14 @@ elif compset -P '\('; then
 
   _values -s '' 'subscript flags' $flags
 elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
-  local suf
+  local suf MATCH MBEGIN MEND
+  local -a keys
+  keys=(${${(kP)compstate[parameter]}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH})
 
   [[ "$RBUFFER" != (|\\)\]* ]] && suf="$osuf"
 
   _wanted association-keys expl 'association key' \
-      compadd -S "$suf" -k "$compstate[parameter]"
+      compadd -Q -S "$suf" -a keys
 elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
   local list i j ret=1 disp