diff options
-rw-r--r-- | src/nvim/screen.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 6728328e55..3179a73ffd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4242,14 +4242,13 @@ win_line ( * Don't do this for double-width characters. * Don't do this for a window not at the right screen border. */ - if (!(has_mbyte - && (utf_off2cells(LineOffset[screen_row], - LineOffset[screen_row] + screen_Columns) + if (!(utf_off2cells(LineOffset[screen_row], + LineOffset[screen_row] + screen_Columns) == 2 || utf_off2cells(LineOffset[screen_row - 1] + (int)Columns - 2, LineOffset[screen_row] + screen_Columns) - == 2)) + == 2) ) { ui_add_linewrap(screen_row-1); } @@ -4383,7 +4382,7 @@ static void screen_line(int row, int coloff, int endcol, redraw_next = char_needs_redraw(off_from, off_to, endcol - col); while (col < endcol) { - if (has_mbyte && (col + 1 < endcol)) + if (col + 1 < endcol) char_cells = utf_off2cells(off_from, max_off_from); else char_cells = 1; @@ -4403,7 +4402,7 @@ static void screen_line(int row, int coloff, int endcol, // the right halve of the old character. // Also required when writing the right halve of a double-width // char over the left halve of an existing one - if (has_mbyte && col + char_cells == endcol + if (col + char_cells == endcol && ((char_cells == 1 && utf_off2cells(off_to, max_off_to) > 1) || (char_cells == 2 |