aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/ui.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-07-24 09:55:31 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-07-24 16:38:51 +0200
commitdcac926ced82c64ab6041a52e97331f1af1930d9 (patch)
treee457b3a7c09dc3af61aee29dcf0289c1b7ce90c8 /src/nvim/api/ui.c
parentd545413492327b431fe20c472f41cc82139f7049 (diff)
downloadrneovim-dcac926ced82c64ab6041a52e97331f1af1930d9.tar.gz
rneovim-dcac926ced82c64ab6041a52e97331f1af1930d9.tar.bz2
rneovim-dcac926ced82c64ab6041a52e97331f1af1930d9.zip
ui: fix glitches where scrolling region affects clearing of screen
the first implemented UI protocol clients (python-gui and builitin TUI) allowed the cleared region to be restricted by setting the scroll region. This was never used by nvim though, and not documented and implemented by newer clients, to check we remain compatible with both kind of clients, ensure the scroll region is in a reset state.
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r--src/nvim/api/ui.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 63c2c4a1b9..d0db43c588 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -302,6 +302,15 @@ static void remote_ui_grid_scroll(UI *ui, Integer grid, Integer top,
args = (Array)ARRAY_DICT_INIT;
ADD(args, INTEGER_OBJ(rows));
push_call(ui, "scroll", args);
+
+ // some clients have "clear" being affected by scroll region,
+ // so reset it.
+ args = (Array)ARRAY_DICT_INIT;
+ ADD(args, INTEGER_OBJ(0));
+ ADD(args, INTEGER_OBJ(ui->height-1));
+ ADD(args, INTEGER_OBJ(0));
+ ADD(args, INTEGER_OBJ(ui->width-1));
+ push_call(ui, "set_scroll_region", args);
}
}