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

PATCH: a bit of completion fixing



I've looked at the cmpletion quoting/nested braces stuff at the
weekend and now think that I don't like keeping all quotes in place
because it can get ugly with the lexing stuff and because I'm not sure 
what we should report as the quoting-state in such cases and because
since the completion code may move the cursor around -- out of quotes
into a unquoted part of the word or the other way round and so on. I
like the `concept' of some kind of canonical quoting form for the
completion code which we have now (which is basically: keep
surrounding single and double quotes and otherwise use only
backslashes).

However, the bug mentioned by Tanaka in 7391 should be fixed (by the
patch below).

This also fixes a problem with `r:|=*' match specs (they were ignored) 
which I introduced last week. Sorry.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Sun Aug 29 20:00:30 1999
+++ Src/Zle/zle_tricky.c	Sun Aug 29 14:24:52 1999
@@ -1592,7 +1592,7 @@
 		else if (*p == Snull)
 		    *p = '\'';
 	}
-	if (*s == Snull || *s == Dnull) {
+	if ((*s == Snull || *s == Dnull) && !has_token(s + 1)) {
 	    char *q = (*s == Snull ? "'" : "\""), *n = tricat(qipre, q, "");
 	    int sl = strlen(s);
 
@@ -2299,7 +2299,7 @@
 		t = 1;
 		if ((lm && lm == mp) ||
 		    ((oll == ll || olw == lw) &&
-		     (test == 1 || (!mp->left && !mp->right)) &&
+		     (test == 1 || (test && !mp->left && !mp->right)) &&
 		     mp->wlen < 0))
 		    /* If we were called recursively, don't use `*' patterns
 		     * at the beginning (avoiding infinite recursion). */

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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