aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-08-02 14:03:22 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-08-14 12:34:35 +0200
commite5bcf8338054c92ae5c505c110208274e5b52b7d (patch)
treecc1ac1d1d2d177cb4125a38faf927eb66acc134b
parent6c5f9219ef55bab06850346d256a09c7c89f297e (diff)
downloadrneovim-e5bcf8338054c92ae5c505c110208274e5b52b7d.tar.gz
rneovim-e5bcf8338054c92ae5c505c110208274e5b52b7d.tar.bz2
rneovim-e5bcf8338054c92ae5c505c110208274e5b52b7d.zip
tui: hack for invalid first line with non-bce resize
-rw-r--r--src/nvim/tui/tui.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 58d1b09d55..e80d1cdc59 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -88,6 +88,7 @@ typedef struct {
bool cont_received;
UGrid grid;
kvec_t(Rect) invalid_regions;
+ bool did_resize;
int row, col;
int out_fd;
bool scroll_region_is_full_screen;
@@ -738,6 +739,14 @@ static void clear_region(UI *ui, int top, int bot, int left, int right,
cursor_goto(ui, row, col);
print_cell(ui, cell);
});
+
+ if (data->did_resize && top == 0) {
+ // TODO(bfredl): the first line of the screen doesn't gets properly
+ // cleared after resize by the loop above, so redraw the final state
+ // after the next flush.
+ invalidate(ui, 0, bot, left, right);
+ data->did_resize = false;
+ }
}
// restore cursor
@@ -813,6 +822,7 @@ static void tui_grid_resize(UI *ui, Integer g, Integer width, Integer height)
TUIData *data = ui->data;
UGrid *grid = &data->grid;
ugrid_resize(grid, (int)width, (int)height);
+ data->did_resize = true;
// resize might not always be followed by a clear before flush
// so clip the invalid region