aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-12-15 12:54:06 +0100
committerGitHub <noreply@github.com>2018-12-15 12:54:06 +0100
commit2aba5569a1fa3154560a4a715b48f8ddd5c0aa25 (patch)
tree2353d3a1d2d5fd806cc3aa76c6103b07ed71f9a0
parentc16529afa5c8eb0314b8c2a35eb033141f0246f9 (diff)
parent8fb1fce694d1bba1992ec954f7381fd058b69fda (diff)
downloadrneovim-2aba5569a1fa3154560a4a715b48f8ddd5c0aa25.tar.gz
rneovim-2aba5569a1fa3154560a4a715b48f8ddd5c0aa25.tar.bz2
rneovim-2aba5569a1fa3154560a4a715b48f8ddd5c0aa25.zip
Merge pull request #9368 from bfredl/doublewrap
TUI: handle wrap of doublewidth chars correctly
-rw-r--r--src/nvim/tui/tui.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index dfee73b85e..26896a141d 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1279,9 +1279,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