Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _subscript: fix the completion of associative array keys
- X-seq: zsh-workers 37787
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _subscript: fix the completion of associative array keys
- Date: Tue, 26 Jan 2016 01:49:27 -0500
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
iirc the way ${(P)var} works was changed/"fix"(?) recently, but i can't find
the thread now so i may be wrong. But currently: $options[<tab>
completes values not the keys.
---
Completion/Zsh/Context/_subscript | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 0ccc0c4..5e898d8 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -81,7 +81,7 @@ elif compset -P '\('; then
elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
local suf MATCH MBEGIN MEND
local -a keys
- keys=(${${(kP)compstate[parameter]}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH})
+ keys=(${${(k)${(P)compstate[parameter]}}//(#m)[\$\\\[\]\(\)\[\{\}]/\\$MATCH})
keys=(${keys//#%(#m)[*@]/(e)$MATCH})
[[ "$RBUFFER" != (|\\)\]* ]] && suf="$osuf"
--
2.6.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author