zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: SUFFIX problem.
@ 2000-05-15  9:50 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-05-15  9:50 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> Z(4):akr@serein% zsh -f
> serein% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> serein% _tst () { print -lr - "$SUFFIX" }
> serein% setopt listpacked rcquotes completeinword
> serein% tst '<TAB>a''<TAB>
> ->
> serein% tst '
> a''ackeda''''
> 
> SUFFIX has broken value.

Urgh. With rcquotes set, the lexer gave the completion code the string 
with the thinned out quotes (i.e. only one quote in the string), but
reported the positions relative to the whole string on the line.

Bye
 Sven

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.8
diff -u -r1.8 zle_tricky.c
--- Src/Zle/zle_tricky.c	2000/05/09 11:04:45	1.8
+++ Src/Zle/zle_tricky.c	2000/05/15 09:49:50
@@ -1326,10 +1326,12 @@
 	autoq = ztrdup(q);
     }
     /* While building the quoted form, we also clean up the command line. */
-    for (p = s, tt = qword, i = wb; *p; p++, tt++, i++)
+    for (p = s, tt = qword, i = wb, j = 0; *p; p++, tt++, i++)
 	if (INULL(*p)) {
 	    if (i < cs)
 		offs--;
+	    if (*p == Snull)
+		j = 1-j;
 	    if (p[1] || *p != Bnull) {
 		if (*p == Bnull) {
 		    *tt = '\\';
@@ -1356,7 +1358,8 @@
 		we--;
 	    }
 	    chuck(p--);
-	}
+	} else if (j && *p == '\'' && i < cs)
+	    offs--;
 
     zsfree(origword);
     origword = ztrdup(s);

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

only message in thread, other threads:[~2000-05-15  9:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-15  9:50 PATCH: Re: SUFFIX problem Sven Wischnowsky

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