0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.2-200

This commit is contained in:
Bram Moolenaar
2009-06-16 13:12:07 +00:00
parent bfa2824d7e
commit feba08b22a
6 changed files with 111 additions and 7 deletions

View File

@@ -6077,12 +6077,15 @@ gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
# ifdef FEAT_MBYTE
if (enc_utf8)
{
c = utf_ptr2char(p);
int pcc[MAX_MCO];
/* TODO: use the composing characters */
c = utfc_ptr2char_len(p, &pcc, len - (p - s));
if (c >= 0x10000) /* show chars > 0xffff as ? */
c = 0xbf;
buf[textlen].byte1 = c >> 8;
buf[textlen].byte2 = c;
p += utf_ptr2len(p);
p += utfc_ptr2len_len(p, len - (p - s));
width += utf_char2cells(c);
}
else
@@ -6106,8 +6109,8 @@ gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
if (has_mbyte)
{
width = 0;
for (p = s; p < s + len; p += (*mb_ptr2len)(p))
width += (*mb_ptr2cells)(p);
for (p = s; p < s + len; p += (*mb_ptr2len_len)(p, len - (p - s)))
width += (*mb_ptr2cells_len)(p, len - (p - s));
}
else
# endif