0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

Added strwidth() and strchars() functions.

This commit is contained in:
Bram Moolenaar
2010-07-18 15:31:08 +02:00
parent 9855d6b361
commit 72597a57b5
10 changed files with 99 additions and 42 deletions

View File

@@ -2261,12 +2261,8 @@ gui_mch_draw_string(
#ifdef FEAT_MBYTE
if (has_mbyte)
{
int cell_len = 0;
/* Compute the length in display cells. */
for (n = 0; n < len; n += MB_BYTE2LEN(text[n]))
cell_len += (*mb_ptr2cells)(text + n);
rc.right = FILL_X(col + cell_len);
rc.right = FILL_X(col + mb_string2cells(text, len));
}
else
#endif