From 046f4cf49e1a082f78b0acadadae8855db5cb37e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 29 Sep 2005 17:32:34 +0000 Subject: 21784: Improved character widths for formatted multibyte character output --- Src/Zle/compresult.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Src/Zle/compresult.c') diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index d80a60ac1..ad8c8ea62 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -1509,7 +1509,7 @@ calclist(int showall) nlines += 1 + printfmt(m->disp, 0, 0, 0); g->flags |= CGF_HASDL; } else { - l = niceztrlen(m->disp); + l = ZMB_nicewidth(m->disp); ndisp++; if (l > glong) glong = l; @@ -1524,7 +1524,7 @@ calclist(int showall) if (!(m->flags & CMF_ROWS)) g->flags &= ~CGF_ROWS; } else { - l = niceztrlen(m->str) + !!m->modec; + l = ZMB_nicewidth(m->str) + !!m->modec; ndisp++; if (l > glong) glong = l; @@ -2146,11 +2146,19 @@ iprintm(Cmgroup g, Cmatch *mp, UNUSED(int mc), UNUSED(int ml), int lastc, int wi printfmt(m->disp, 0, 1, 0); return; } +#ifdef ZLE_UNICODE_SUPPORT + len = mb_niceformat(m->disp, shout, NULL); +#else nicezputs(m->disp, shout); len = niceztrlen(m->disp); +#endif } else { +#ifdef ZLE_UNICODE_SUPPORT + len = mb_niceformat(m->str, shout, NULL); +#else nicezputs(m->str, shout); len = niceztrlen(m->str); +#endif if ((g->flags & CGF_FILES) && m->modec) { putc(m->modec, shout); -- cgit 1.4.1