Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A minor glitch with _arguments



Bart Schaefer wrote:

> Putting quotes around an option string convinces _arguments that it has
> reached the end of the options.  E.g. using zsh's configure script as a
> test case:
> 
> zsh% ./configure '--enable-dynamic' --<TAB>
> No matches for `corrections'
> 
> Remove the quotes, or move the left one even one character to the right,
> and everything starts completing again.

The problem is that compwords contains the words from the line as they
appear there, including quotes.  We had a lot of discussion about the
ups and downs of that which I don't want to revive.

The patch makes comparguments remove one level of quoting.  Was there a
simpler way to achieve that?

Bye
  Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.50
diff -u -r1.50 computil.c
--- Src/Zle/computil.c	2001/04/26 12:13:37	1.50
+++ Src/Zle/computil.c	2001/05/02 09:18:29
@@ -1317,6 +1317,12 @@
 	dopt = NULL;
 	doff = state.singles = arglast = 0;
 
+        /* remove quotes */
+        line = dupstring(line);
+        parse_subst_string(line);
+        remnulargs(line);
+        untokenize(line);
+
 	if (ca_inactive(d, argxor, cur, 0, NULL) ||
 	    ((d->flags & CDF_SEP) && cur != compcurrent && !strcmp(line, "--"))) {
 	    if (ca_inactive(d, NULL, cur, 1, NULL))

-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author