Re: [Mutt] #3048: ZWSP at start of line causes display problems in
#3048: ZWSP at start of line causes display problems in pager
Comment (by pdmef):
I've put some debug code in mutt_addwch():
{{{
diff --git a/curs_lib.c b/curs_lib.c
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -676,8 +676,15 @@ int mutt_addwch (wchar_t wc)
if ((n1 = wcrtomb (buf, wc, &mbstate)) == (size_t)(-1) ||
(n2 = wcrtomb (buf + n1, 0, &mbstate)) == (size_t)(-1))
return -1; /* ERR */
- else
- return addstr (buf);
+ else {
+ int rc, y1, y2, x1, x2;
+ getyx (stdscr, y1, x1);
+ rc = addstr (buf);
+ getyx (stdscr, y2, x2);
+ dprint (5, (debugfile, "addstr rc=%d (%d,%d)->(%d,%d) [%s]\n",
+ rc, y1, x1, y2, x2, buf));
+ return rc;
+ }
}
}}}
When looking at the debug out I see on OS X:
{{{
addstr rc=0 (15,0)->(15,1) []
addstr rc=0 (15,1)->(15,2) [T]
addstr rc=0 (15,2)->(15,3) [h]
addstr rc=0 (15,3)->(15,4) [e]
addstr rc=0 (15,4)->(15,5) [r]
addstr rc=0 (15,5)->(15,6) [e]
}}}
(note that this looks broken as ZWSP should have 0 width but it's off-by-
one) for the offending line while on Linux I get:
{{{
addstr rc=0 (15,0)->(15,192) []
addstr rc=0 (15,192)->(16,0) [T]
addstr rc=0 (16,0)->(16,1) [h]
addstr rc=0 (16,1)->(16,2) [e]
addstr rc=0 (16,2)->(16,3) [r]
addstr rc=0 (16,3)->(16,4) [e]
}}}
So to me this looks like a curses issue as it's the addstr() call moving
COLS-1 cells to the right for ZWSP. I had no luck in fixing the issue
using add_wch() curses call instead of addstr() to add the mbyte character
directly.
But since the problem remains for two 5.6-X ncurses versions (at least for
me) on OS X vs. Linux, I wonder whether there's some compile-time magic
for ncurses causing this regarding wide-character support.
As I tried using mutt's instead of the system's wide character routines, I
think we can exclude that as the bug's source, too.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3048#comment:4>