From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3834 invoked by alias); 25 Sep 2017 15:16:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41762 Received: (qmail 7978 invoked by uid 1010); 25 Sep 2017 15:16:20 -0000 X-Qmail-Scanner-Diagnostics: from sonic307-7.consmr.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(87.248.110.32):SA:0(-4.7/5.0):. Processed in 4.726 secs); 25 Sep 2017 15:16:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-YMail-OSG: DAkeh_4VM1llVlztFFE8kXOuxyvIAsy794ryyhugl5YzozhywI4D4XnpRKG8G2i h6ymA_7RVFL0P4smcpZaHCauLFc4fuZpSzDmaGNDXOGDd_K45vHC7lq7G7SPE7hD0lfg1ILXXCSG tGpb80pKnVsNJSne0ZZTaxwIwVJ1yxNOnVm0jQbs1G.Y48oFooGm0VcGduFY2.WybvVNE440uaNm fQzzPQ4dly.xhBgnj3BD1jNU.uUsMLRfJdP_q.bU9uHb258NhbAvy.cFDV4YVTfKMsQCjisTm6Ce gQ6rAqMgrAaID1OFNerQ6eD3WAxSWg2iF5reGxXNS_NsYdzAaDcDdH80ItFNalFrE1zz_M2A3xcS ml4ceaXelENrK9Phks04x7F2J4QlRQXZqKfJKJivk.l_Q5LuIHpu5qQ9sOJHrk95TnfHXVq4jWg9 EOfu29qjODrgju9kar5JLJ70hzUnmJB9uOLMOFIlkJwRn9ERkRsEFW6NaW2Y9GASjnDXgjg-- X-Yahoo-Newman-Id: 497189.51247.bm@smtp103.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: DAkeh_4VM1llVlztFFE8kXOuxyvIAsy794ryyhugl5Yzozh ywI4D4XnpRKG8G2ih6ymA_7RVFL0P4smcpZaHCauLFc4fuZpSzDmaGNDXOGD d_K45vHC7lq7G7SPE7hD0lfg1ILXXCSGtGpb80pKnVsNJSne0ZZTaxwIwVJ1 yxNOnVm0jQbs1G.Y48oFooGm0VcGduFY2.WybvVNE440uaNmfQzzPQ4dly.x hBgnj3BD1jNU.uUsMLRfJdP_q.bU9uHb258NhbAvy.cFDV4YVTfKMsQCjisT m6CegQ6rAqMgrAaID1OFNerQ6eD3WAxSWg2iF5reGxXNS_NsYdzAaDcDdH80 ItFNalFrE1zz_M2A3xcSml4ceaXelENrK9Phks04x7F2J4QlRQXZqKfJKJiv k.l_Q5LuIHpu5qQ9sOJHrk95TnfHXVq4jWg9EOfu29qjODrgju9kar5JLJ70 hzUnmJB9uOLMOFIlkJwRn9ERkRsEFW6NaW2Y9GASjnDXgjg-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: completion after assignment MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13942.1506347146.1@thecus.kiddle.eu> Date: Mon, 25 Sep 2017 15:45:46 +0200 Message-ID: <13943.1506347146@thecus.kiddle.eu> 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 I've no idea how to fix that. Completion also looks wrong in the case of assoc[key]=. 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 .