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

Re: completion bug?



Gabor wrote:

> I have found an interesting completion bug in 3.1.6 which did not
> exist in 3.1.5.  Here is the gist of it.
> $ some_command $(<.s
> at this point I hit tab and I have a directory called .ssh.  Instead of
> completing it, it adds another '.' and then beeps at me.  If I complete
> the directory name itself, then type tab for the contents, it then
> reinserts the directory name again.
> $ some_command $(<.ssh/
> now it inserts .ssh again after the forward slash.  If I type in the
> the first character of the name I want completed it works fine.  It's
> a totally weird bug.  You have to try it yourself to understand it.  I
> tried it in 3.1.5 and it didn't do this.

Whoa. We had some trouble with the changed command line parsing for
completion, but this once worked.

This should fix it.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Wed Aug 25 14:58:19 1999
+++ Src/Zle/zle_tricky.c	Wed Aug 25 16:57:32 1999
@@ -1422,7 +1422,7 @@
 	    if (parend >= 0 && !tmp)
 		line = (unsigned char *) dupstring(tmp = (char *)line);
 	    linptr = (char *) line + ll + addedx - parbegin + 1;
-	    if ((linptr - (char *) line) < 2 ||
+	    if ((linptr - (char *) line) < 3 || *linptr != '(' ||
 		linptr[-1] != '(' || linptr[-2] != '$') {
 		if (parend >= 0) {
 		    ll -= parend;
@@ -1482,6 +1482,7 @@
 		tmp = NULL;
 		linptr = (char *)line;
 		lexrestore();
+		addedx = 0;
 		goto start;
 	    }
 	    noaliases = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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