fixed drawing zerowidth characters

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2009-10-24 13:32:33 +00:00
parent e29e6126a6
commit acd0ed038d
2 changed files with 14 additions and 8 deletions

View File

@ -180,11 +180,14 @@ mcview_display_nroff (mcview_t * view)
#endif
tty_print_anychar (c);
}
#ifdef HAVE_CHARSET
if (view->utf8 && g_unichar_iswide(c))
col++;
#endif
col++;
#ifdef HAVE_CHARSET
if (view->utf8)
if (g_unichar_iswide(c))
col++;
else if (g_unichar_iszerowidth(c))
col--;
#endif
tty_setcolor (NORMAL_COLOR);
}
view->dpy_end = from;

View File

@ -151,11 +151,14 @@ mcview_display_text (mcview_t * view)
#endif
tty_print_anychar (c);
}
#ifdef HAVE_CHARSET
if (view->utf8 && g_unichar_iswide(c))
col++;
#endif
col++;
#ifdef HAVE_CHARSET
if (view->utf8)
if (g_unichar_iswide(c))
col++;
else if (g_unichar_iszerowidth(c))
col--;
#endif
tty_setcolor (NORMAL_COLOR);
}
view->dpy_end = from;