Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
completion after assignment
- X-seq: zsh-workers 41762
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: completion after assignment
- Date: Mon, 25 Sep 2017 15:45:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1506352566; bh=P3StvaARKDFXGUaNmkpFRQfk/h0dPADm2q8bquaSe5c=; h=From:To:Subject:Date:From:Subject; b=C2xQ8QTyykE/n3iKTz4rSZN453vPZGb+6qtUFJMdhuBk+LmMgEMd1gZt2cs8T+joGt0yRYKDo/9FTWIlf+JPLdQfcoLmyPQeNKEnQJf7eXCPyLt13E8UejRTQp8YYZUIljHnQFV4H/rhxbWGiCVU65mk5K+MWxdzoxLAmrH80l9LF5P6ZzxjmdgIhW2VdrwjheKWaAokZM+h9jIIseRXSNYKT+2tlNJtt4Lz2LmDsqa4spjvtvZtdTphdr95PZqqtbeFEWjOw/JTSv+0nJYUL7/jni/1TlyoCHrIj8Iwzv3EwBqs70MsTW21mKk+TMrPUc/525yLsjgLUaAtnj+ddg==
- 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
I was experimenting with completion in associative array assignments and
it appears that things are broken even before the recent var=( []=.. )
stuff.
_value wants to alternate between association keys and values
(defaulting to filenames) but it appears to do association keys in both
the first and second words before it starts to alternate. Something has
gone wrong with indexing of the first element. I can trace this back
to 36025 which was a hack at this area of code to allow for completion
after something like
RPS2=$PS2; unset PS2 ; setopt <TAB>
I've no idea how to fix that.
Completion also looks wrong in the case of assoc[key]=<TAB>. I think the
following patch is the correct way to address that.
Oliver
diff --git a/Completion/Zsh/Context/_value b/Completion/Zsh/Context/_value
index 22372ab36..5e74100c6 100644
--- a/Completion/Zsh/Context/_value
+++ b/Completion/Zsh/Context/_value
@@ -22,7 +22,7 @@ if [[ "$service" != -value-,* ]]; then
-value-,{${compstate[parameter]},-default-},${^strs}
else
if [[ "$compstate[parameter]" != *-* &&
- "$compstate[context]" = *value &&
+ "$compstate[context]" = array_value &&
"${(Pt)${compstate[parameter]}}" = assoc* ]]; then
local expl
if (( CURRENT & 1 )); then
.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author