Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: brace in alias name and compsys
- X-seq: zsh-workers 32117
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: brace in alias name and compsys
- Date: Sun, 15 Dec 2013 20:38:21 +0000
- In-reply-to: <131215115236.ZM20467@torch.brasslantern.com>
- 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
- References: <20131215073603.GA97197@redoubt.spodhuis.org> <131215115236.ZM20467@torch.brasslantern.com>
On Sun, 15 Dec 2013 11:52:36 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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.
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index e30e0b1..6ed4a0e 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1505,7 +1505,11 @@ get_comp_string(void)
else
nnb = s;
for (tt = s; tt < s + zlemetacs_qsub - wb;) {
- if (*tt == Inbrack) {
+ /*
+ * Ignore '[' at the start of a command as it's not
+ * matched by a closing bracket.
+ */
+ if (*tt == Inbrack && (tt != s || !lincmd)) {
i++;
nb = nnb;
ne = tt;
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author