comparison src/screen.c @ 13024:27934188d7b5 v8.0.1388

patch 8.0.1388: char not overwritten with ambiguous width char commit https://github.com/vim/vim/commit/fae8ed1fc8c06b28528d726e8440dfc66852bca8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 12 22:29:30 2017 +0100 patch 8.0.1388: char not overwritten with ambiguous width char Problem: Char not overwritten with ambiguous width char, if the ambiguous char is single width but we reserve double-width space. Solution: First clear the screen cells. (Ozaki Kiichi, closes #2436)
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Dec 2017 22:30:05 +0100
parents dd734ee3e2fe
children 72366f4e3264
comparison
equal deleted inserted replaced
13023:999318b2de68 13024:27934188d7b5
8315 #ifdef FEAT_MBYTE 8315 #ifdef FEAT_MBYTE
8316 if (enc_utf8 && ScreenLinesUC[off] != 0) 8316 if (enc_utf8 && ScreenLinesUC[off] != 0)
8317 { 8317 {
8318 char_u buf[MB_MAXBYTES + 1]; 8318 char_u buf[MB_MAXBYTES + 1];
8319 8319
8320 /* Convert UTF-8 character to bytes and write it. */
8321
8322 buf[utfc_char2bytes(off, buf)] = NUL;
8323
8324 out_str(buf);
8325 if (utf_ambiguous_width(ScreenLinesUC[off])) 8320 if (utf_ambiguous_width(ScreenLinesUC[off]))
8321 {
8322 if (*p_ambw == 'd'
8323 # ifdef FEAT_GUI
8324 && !gui.in_use
8325 # endif
8326 )
8327 {
8328 /* Clear the two screen cells. If the character is actually
8329 * single width it won't change the second cell. */
8330 out_str((char_u *)" ");
8331 term_windgoto(row, col);
8332 }
8333 /* not sure where the cursor is after drawing the ambiguous width
8334 * character */
8326 screen_cur_col = 9999; 8335 screen_cur_col = 9999;
8336 }
8327 else if (utf_char2cells(ScreenLinesUC[off]) > 1) 8337 else if (utf_char2cells(ScreenLinesUC[off]) > 1)
8328 ++screen_cur_col; 8338 ++screen_cur_col;
8339
8340 /* Convert the UTF-8 character to bytes and write it. */
8341 buf[utfc_char2bytes(off, buf)] = NUL;
8342 out_str(buf);
8329 } 8343 }
8330 else 8344 else
8331 #endif 8345 #endif
8332 { 8346 {
8333 #ifdef FEAT_MBYTE 8347 #ifdef FEAT_MBYTE