From dcac926ced82c64ab6041a52e97331f1af1930d9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 24 Jul 2018 09:55:31 +0200 Subject: 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. --- src/nvim/api/ui.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/api') 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); } } -- cgit