From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15074 invoked by alias); 15 Dec 2013 21:14:16 -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: 32119 Received: (qmail 5291 invoked from network); 15 Dec 2013 21:14:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=H2E9/dSDOvY0kM+x2esjiT9Y01Jmx0LMy8KuWYOFUrQ=; b=DybRVJOUUcQpE8LDTnZurNxxGilSrFJd+zG4zMoQMY2GJ3fPSmIzlrGx4P4KJRFZP5 387CO12IEo/ol+G5KS945voyR+40kj/zylgGDcKPXHCQNYVSkDhwE9fK9JiliW2cMjLH cr3rxjfWUNFjfsGd96fxYwOwalIJ1BqKtfn+NXDnDWV8rzg5CDozIzsKtBLReXFsyVbJ wFU6iw4TLMfI2wNQ1Y6bgZS6nyGUFjKtDcRa5bp9w9r1ssEVkl0+dEVIZQavX2qFzxmF DADTlAD6TeBHn79zOwMSwj5rjQvnX3+O85KrqVmlEFqGShbet5sYcAxZ0WbzdRcwrS2+ G9tA== X-Gm-Message-State: ALoCoQnOoiIgDb86LcKMQIerJJKSmBJA9h2TM2ET5F/ykUMDgmblOd6g42F23ggUSGq7U2feaRGf X-Received: by 10.180.228.132 with SMTP id si4mr11033001wic.2.1387142038561; Sun, 15 Dec 2013 13:13:58 -0800 (PST) X-ProxyUser-IP: 86.6.157.246 Date: Sun, 15 Dec 2013 21:13:55 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: brace in alias name and compsys Message-ID: <20131215211355.44a82f6d@pws-pc.ntlworld.com> In-Reply-To: <20131215211119.09f60172@pws-pc.ntlworld.com> References: <20131215073603.GA97197@redoubt.spodhuis.org> <131215115236.ZM20467@torch.brasslantern.com> <20131215203821.1c3f2b69@pws-pc.ntlworld.com> <20131215211119.09f60172@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 15 Dec 2013 21:11:19 +0000 Peter Stephenson wrote: > On Sun, 15 Dec 2013 20:38:21 +0000 > Peter Stephenson wrote: > > On Sun, 15 Dec 2013 11:52:36 -0800 > > Bart Schaefer wrote: > > > While we're on the subject, completing after "[" or "[[" in command > > > position (no intervening whitespace) incorrectly attempts subscript > > > completion. This appears to be a bug somewhere in the internals, > > > because compstate[context] has been set to 'subscript' and there's no > > > assignment to that in _complete_debug output. > > > > I think it's something like this. > > This is probably better. Except I need to get it right. diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index e30e0b1..2f3cdab 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1504,7 +1504,17 @@ get_comp_string(void) nnb = s + MB_METACHARLEN(s); else nnb = s; - for (tt = s; tt < s + zlemetacs_qsub - wb;) { + tt = s; + if (lincmd) + { + /* + * Ignore '['s at the start of a command as they're not + * matched by closing brackets. + */ + while (*tt == Inbrack) + tt++; + } + for (; tt < s + zlemetacs_qsub - wb;) { if (*tt == Inbrack) { i++; nb = nnb; -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/