zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: brace in alias name and compsys
Date: Sun, 15 Dec 2013 21:13:55 +0000	[thread overview]
Message-ID: <20131215211355.44a82f6d@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20131215211119.09f60172@pws-pc.ntlworld.com>

On Sun, 15 Dec 2013 21:11:19 +0000
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> On Sun, 15 Dec 2013 20:38:21 +0000
> Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> > On Sun, 15 Dec 2013 11:52:36 -0800
> > Bart Schaefer <schaefer@brasslantern.com> 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 <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2013-12-15 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131215073603.GA97197@redoubt.spodhuis.org>
     [not found] ` <131215115236.ZM20467@torch.brasslantern.com>
2013-12-15 20:38   ` Peter Stephenson
2013-12-15 21:11     ` Peter Stephenson
2013-12-15 21:13       ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131215211355.44a82f6d@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).