summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-06-16 13:12:07 +0000
committerBram Moolenaar <Bram@vim.org>2009-06-16 13:12:07 +0000
commitfeba08b22a367b13ce42f422a9cf8871295a401a (patch)
treedddb1e33b6ea4438d7f176cdc0bfcdfe4a28fa10 /src/gui_gtk_x11.c
parentbfa2824d7ed3ef2a9987a666e9f93abd7d1e341d (diff)
updated for version 7.2-200v7.2.200
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 87c73fd9c1..e44ae0628e 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -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