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

PATCH for 3.0.6 (was: Re: compctl question)



I wrote:

>   foo() { reply=( ~/mail/${1[2,-1]}*${2}(N:t) ); reply=( \\\=$^reply ); }
>   compctl -x 'S[=],S[\\=]' -UQK foo -- bar

Those who have tried this with 3.0.6 will have noticed a display bug:
in listmatches() trashzle() gets called with the line prepared for
completion. If there are characters that need quoting, ll will be
different from the real line length. The patch below is a *very*
simple(-minded) attempt to fix that. But due to its simplicity it
should be very robust.

Bye
 Sven

--- Src/zle_tricky.c.old	Mon May 10 13:21:55 1999
+++ Src/zle_tricky.c	Mon May 10 13:22:03 1999
@@ -3543,6 +3543,7 @@
 	!(haswhat & (HAS_MISC | HAS_PATHPAT)) ? niceztrlen(psuf) : 0;
 
     /* Set the cursor below the prompt. */
+    ll = strlen(line);
     trashzle();
     ct = nmatches;
     showinglist = listshown = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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