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

Re: [PATCH] _describe and literal \n

Daniel Shahaf wrote on Thu, Sep 29, 2016 at 14:11:39 +0000:
> Using 'nice' widths in compdescribe fixes the case from 38928, but not
> the one from 38925.  I think that one simply needs a s/zputs/nicezputs/
> somewhere in the "not part of a group" codepath.

The following appears to be the missing 'nice'.  On the 38925 case, it
causes the newlines to be output as \n (two characters) rather than
dumpd to stdout literally, but it messes up the cursor position:
pressing <TAB> redraws the prompt two lines above where it started.


diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 7fec7c8..0e09e1b 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -2236,7 +2236,7 @@ iprintm(Cmgroup g, Cmatch *mp, UNUSED(int mc), UNUSED(int ml), int lastc, int wi
     if (m->disp) {
 	if (m->flags & CMF_DISPLINE) {
-	    printfmt(m->disp, 0, 1, 0);
+	    printfmt(nicedupstring(m->disp), 0, 1, 0);

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