* Re: Allow completion to work with files starting with = (equal sign)
[not found] ` <200710031527.l93FRSXS016734@news01.csr.com>
@ 2007-10-03 16:12 ` Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2007-10-03 16:12 UTC (permalink / raw)
To: zsh-workers
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@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-03 16:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <19c433eb0710030742ya478e23ldb2854ca0e9a4faa@mail.gmail.com>
[not found] ` <200710031527.l93FRSXS016734@news01.csr.com>
2007-10-03 16:12 ` Allow completion to work with files starting with = (equal sign) Peter Stephenson
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).