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

Re: Allow completion to work with files starting with = (equal sign)



I quite like this patch anyway, though I think new completion already
handles this.

Index: Src/Zle/compctl.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compctl.c,v
retrieving revision 1.34
diff -u -r1.34 compctl.c
--- Src/Zle/compctl.c	6 Jul 2007 21:52:40 -0000	1.34
+++ Src/Zle/compctl.c	3 Oct 2007 16:09:51 -0000
@@ -3501,7 +3501,7 @@
 					p++;
 				/* Get the pattern string. */
 				tokenize(g = dupstrpfx(g, p - g));
-				if (*g == '=')
+				if (*g == '=' && isset(EQUALS))
 				    *g = Equals;
 				if (*g == '~')
 				    *g = Tilde;
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.88
diff -u -r1.88 zle_tricky.c
--- Src/Zle/zle_tricky.c	30 Aug 2007 21:46:02 -0000	1.88
+++ Src/Zle/zle_tricky.c	3 Oct 2007 16:09:52 -0000
@@ -1608,6 +1608,13 @@
                     *q = Bnull;
         }
     }
+    /*
+     * Leading "=" gets tokenized in case the EQUALS options
+     * changes afterwards.  It's too late for that now, so restore it
+     * to a plain "=" if the option is unset.
+     */
+    if (*s == Equals && !isset(EQUALS))
+	*s = '=';
     /* While building the quoted form, we also clean up the command line. */
     for (p = s, i = wb, j = 0; *p; p++, i++) {
 	int skipchars;


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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