diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-28 19:23:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-28 19:23:11 +0200 |
commit | a6ce1ccf5c10baa5c2a25897c46961d751a21dda (patch) | |
tree | a4738c5d9aabba0fad6851b23f4120ab629c720f /src/gui_w32.c | |
parent | b9fce6cbf7ed0a2766582c5db797ccf99a838a13 (diff) | |
download | vim-git-a6ce1ccf5c10baa5c2a25897c46961d751a21dda.tar.gz |
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_w32.c')
-rw-r--r-- | src/gui_w32.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index 4eaa2be38..67895cca3 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -6295,8 +6295,8 @@ gui_mch_draw_string( if (enc_utf8 && n < len && unicodebuf != NULL) { - /* Output UTF-8 characters. Caller has already separated - * composing characters. */ + /* Output UTF-8 characters. Composing characters should be + * handled here. */ int i; int wlen; /* string length in words */ int clen; /* string length in characters */ @@ -6320,9 +6320,16 @@ gui_mch_draw_string( { unicodebuf[wlen++] = c; } - cw = utf_char2cells(c); - if (cw > 2) /* don't use 4 for unprintable char */ - cw = 1; + + if (utf_iscomposing(c)) + cw = 0; + else + { + cw = utf_char2cells(c); + if (cw > 2) /* don't use 4 for unprintable char */ + cw = 1; + } + if (unicodepdy != NULL) { /* Use unicodepdy to make characters fit as we expect, even @@ -6337,7 +6344,7 @@ gui_mch_draw_string( unicodepdy[wlen - 1] = cw * gui.char_width; } cells += cw; - i += utfc_ptr2len_len(text + i, len - i); + i += utf_ptr2len_len(text + i, len - i); ++clen; } #if defined(FEAT_DIRECTX) |