From 8fb1fce694d1bba1992ec954f7381fd058b69fda Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 15 Dec 2018 09:54:25 +0100 Subject: TUI: handle wrap of doublewidth chars correctly --- src/nvim/tui/tui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 1e0c8e6e25..5e6cf88fca 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1276,9 +1276,10 @@ static void tui_raw_line(UI *ui, Integer g, Integer linerow, Integer startcol, // width and the line continuation is within the grid. if (endcol != grid->width) { - // Print the last cell of the row, if we haven't already done so. - cursor_goto(ui, (int)linerow, grid->width - 1); - print_cell(ui, &grid->cells[linerow][grid->width - 1]); + // Print the last char of the row, if we haven't already done so. + int size = grid->cells[linerow][grid->width - 1].data[0] == NUL ? 2 : 1; + cursor_goto(ui, (int)linerow, grid->width - size); + print_cell(ui, &grid->cells[linerow][grid->width - size]); } // Wrap the cursor over to the next line. The next line will be -- cgit