From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2652 invoked by alias); 15 Dec 2013 21:11:34 -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: 32118 Received: (qmail 23303 invoked from network); 15 Dec 2013 21:11:29 -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=2bFnBWyyOqjsOVdcJbJBmikijfZ2FovbHtYDtCBN4Bk=; b=bfPdEZD4NTE6zdbTIMszS8ArDB/tPrQ5hR6aESdp3wc+N3Y30/y3AA2ENNc5mUE3r1 GQm+IBWT+SCtQxrAmJn1XVCSFbtEX00GjunUPAIehCbkTTpvxYFG2UgiLaPTzZ0wY5hL fFkxWErOzZmt1o6biy9I1tfznAWD4GbenwmEGoNA2YDoS/0aIMDk2FlUrAmdj/KgKxVb /WA+FtvjxIGf22SEGzCPW7r1oZ4PE/62o9sJyZhsQV3N35KegS6zb4SfuWwtrp7YLpF8 U5IKAY5dEtp07l/6N8Wb1hUDRNuJ5NggxkNecs6WSMluMNkoacO6FBA7Gzk37MclQhGQ TwUw== X-Gm-Message-State: ALoCoQlNh4BbIXrmpK+X4mzBsnXQDqMbJ9iNx1LIWyttnEPun7yn19fAFrV7m/YnYSh8nYAX3hX4 X-Received: by 10.180.189.106 with SMTP id gh10mr11122036wic.18.1387141882724; Sun, 15 Dec 2013 13:11:22 -0800 (PST) X-ProxyUser-IP: 86.6.157.246 Date: Sun, 15 Dec 2013 21:11:19 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: brace in alias name and compsys Message-ID: <20131215211119.09f60172@pws-pc.ntlworld.com> In-Reply-To: <20131215203821.1c3f2b69@pws-pc.ntlworld.com> References: <20131215073603.GA97197@redoubt.spodhuis.org> <131215115236.ZM20467@torch.brasslantern.com> <20131215203821.1c3f2b69@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 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. diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index e30e0b1..016cc46 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1504,7 +1504,14 @@ get_comp_string(void) nnb = s + MB_METACHARLEN(s); else nnb = s; - for (tt = s; tt < s + zlemetacs_qsub - wb;) { + tt = s; + /* + * 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/