diff src/gui_gtk_x11.c @ 1903:4c02214d1465 v7.2.200

updated for version 7.2-200
author vimboss
date Tue, 16 Jun 2009 13:12:07 +0000
parents 430f555d7d15
children 062104a823df
line wrap: on
line diff
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -6077,12 +6077,15 @@ gui_mch_draw_string(int row, int col, ch
 # 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, ch
 	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