zsh-workers
 help / color / mirror / code / Atom feed
* Re: completion implementation woes
       [not found]   ` <20161002174320.GV49062@isis.sigpipe.cz>
@ 2016-10-11 21:20     ` Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2016-10-11 21:20 UTC (permalink / raw)
  To: Roman Neuhauser; +Cc: Zsh workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-11 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20161002001931.GA686081@isis.sigpipe.cz>
     [not found] ` <14379.1475371914@hydra.kiddle.eu>
     [not found]   ` <20161002174320.GV49062@isis.sigpipe.cz>
2016-10-11 21:20     ` completion implementation woes Oliver Kiddle

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).