summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-28 19:23:11 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-28 19:23:11 +0200
commita6ce1ccf5c10baa5c2a25897c46961d751a21dda (patch)
treea4738c5d9aabba0fad6851b23f4120ab629c720f /src/gui.c
parentb9fce6cbf7ed0a2766582c5db797ccf99a838a13 (diff)
patch 8.0.1234: MS-Windows: composing chars are not shown properlyv8.0.1234
Problem: MS-Windows: composing characters are not shown properly. Solution: Pass base character and composing characters to the renderer at once. (Ken Takata, closes #2206)
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui.c b/src/gui.c
index fe91062e0a..d52244cc25 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -2429,9 +2429,14 @@ gui_outstr_nowrap(
int cl; /* byte length of current char */
int comping; /* current char is composing */
int scol = col; /* screen column */
- int curr_wide; /* use 'guifontwide' */
+ int curr_wide = FALSE; /* use 'guifontwide' */
int prev_wide = FALSE;
int wide_changed;
+# ifdef WIN3264
+ int sep_comp = FALSE; /* Don't separate composing chars. */
+# else
+ int sep_comp = TRUE; /* Separate composing chars. */
+# endif
/* Break the string at a composing character, it has to be drawn on
* top of the previous character. */
@@ -2441,17 +2446,20 @@ gui_outstr_nowrap(
{
c = utf_ptr2char(s + i);
cn = utf_char2cells(c);
- if (cn > 1
-# ifdef FEAT_XFONTSET
- && fontset == NOFONTSET
-# endif
- && wide_font != NOFONT)
- curr_wide = TRUE;
- else
- curr_wide = FALSE;
comping = utf_iscomposing(c);
if (!comping) /* count cells from non-composing chars */
cells += cn;
+ if (!comping || sep_comp)
+ {
+ if (cn > 1
+# ifdef FEAT_XFONTSET
+ && fontset == NOFONTSET
+# endif
+ && wide_font != NOFONT)
+ curr_wide = TRUE;
+ else
+ curr_wide = FALSE;
+ }
cl = utf_ptr2len(s + i);
if (cl == 0) /* hit end of string */
len = i + cl; /* len must be wrong "cannot happen" */
@@ -2460,7 +2468,8 @@ gui_outstr_nowrap(
/* Print the string so far if it's the last character or there is
* a composing character. */
- if (i + cl >= len || (comping && i > start) || wide_changed
+ if (i + cl >= len || (comping && sep_comp && i > start)
+ || wide_changed
# if defined(FEAT_GUI_X11)
|| (cn > 1
# ifdef FEAT_XFONTSET
@@ -2472,7 +2481,7 @@ gui_outstr_nowrap(
# endif
)
{
- if (comping || wide_changed)
+ if ((comping && sep_comp) || wide_changed)
thislen = i - start;
else
thislen = i - start + cl;
@@ -2490,7 +2499,7 @@ gui_outstr_nowrap(
cells = 0;
/* Adjust to not draw a character which width is changed
* against with last one. */
- if (wide_changed && !comping)
+ if (wide_changed && !(comping && sep_comp))
{
scol -= cn;
cl = 0;
@@ -2509,7 +2518,7 @@ gui_outstr_nowrap(
# endif
}
/* Draw a composing char on top of the previous char. */
- if (comping)
+ if (comping && sep_comp)
{
# if (defined(__APPLE_CC__) || defined(__MRC__)) && TARGET_API_MAC_CARBON
/* Carbon ATSUI autodraws composing char over previous char */