Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion implementation woes
- X-seq: zsh-workers 39611
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Roman Neuhauser <neuhauser@xxxxxxxxxx>
- Subject: Re: completion implementation woes
- Date: Tue, 11 Oct 2016 23:20:41 +0200
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1476220842; bh=ItwR9ToYCk1AQZxQKpPOyhzrSB4/XaWpf+fMtvPCg/w=; h=cc:In-reply-to:From:References:To:Subject:Date:From:Subject; b=IodLlkyHfyTnB+KGeMcjtsAo9rUaK9N69s1HDqV9oMNPOHC+UfljkC8rXa5LV0yb/G26FVCR5OLOSrRxGckW9wDqhyAjTNzwPPl2n7E70M5gCFZiGU5vVl8LLT9/evKUm6QBQb7F8FJzbTUVM7kiDDu8lpg3fEFJWxnoN1GJ6OUArTNmPNA6StfJJgEwF7hWdeBTxYsn01ak4eGWimbGVyGtWpbGHtriCGNZFC+OKpaMqsSRzwfglfZucjiK/nO2DGehFfjlw27y0oIClpELb96xO+qKHUnnJDtcR1rGggOoS16FYSBkfRV3/liBjrs44JgxMag/8G4rZyoin4pNQQ==
- In-reply-to: <20161002174320.GV49062@isis.sigpipe.cz>
- 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: <20161002001931.GA686081@isis.sigpipe.cz> <14379.1475371914@hydra.kiddle.eu> <20161002174320.GV49062@isis.sigpipe.cz>
On 2 Oct, Roman Neuhauser wrote:
> why does '*::' pop $words?
*:: removes all recognised options from $words. *::: would strip it to
just arguments corresponding to this spec.
> is there any chance to get the - thing working with chained _arguments
> calls? this seems to be the least-clutter notation...
Try the patch below. This makes it check if the word is a recognised
option rather than just seeing if it starts with '-' or '+'. I've not
been able to really establish what purpose the whole condition serves.
When it was first added, the sets notation didn't get too much use
because it is slower, requiring multiple parses of the command-line. So
bugs are less likely to have surfaced.
> in fact, i'd love to get as close to a grammatic pov as possible,
There's also _regex_arguments which is closer to a grammatic pov,
though use of it is more than a bit messy compared to plain BNF
notation.
> and the more faithful the representation the better. eg. activate
> does not take any operands, so the '*::option or operand:..' rule
> rubs me the really wrong way.
You don't have to have 'option or operand' in there as a description.
Use a single space to leave it blank.
Oliver
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index e9bad1c..cb3c32f 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2158,7 +2158,8 @@ ca_parse_line(Cadef d, int multi, int first)
state.opt = 0;
else
state.curopt = NULL;
- } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent
+ } else if (multi && (*line == '-' || *line == '+') && cur != compcurrent &&
+ ca_get_opt(d, line, 0, NULL)
#if 0
/**** Ouch. Using this will disable the mutual exclusion
of different sets. Not using it will make the -A
Messages sorted by:
Reverse Date,
Date,
Thread,
Author