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); } } diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 56c47ed6cc..cfcfaa83a0 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -823,7 +823,7 @@ static void tui_grid_clear(UI *ui, Integer g) UGrid *grid = &data->grid; ugrid_clear(grid); kv_size(data->invalid_regions) = 0; - clear_region(ui, grid->top, grid->bot, grid->left, grid->right, + clear_region(ui, 0, grid->height-1, 0, grid->width-1, data->clear_attrs); } diff --git a/src/nvim/ugrid.c b/src/nvim/ugrid.c index 48f3cff2d7..36936970f8 100644 --- a/src/nvim/ugrid.c +++ b/src/nvim/ugrid.c @@ -44,7 +44,7 @@ void ugrid_resize(UGrid *grid, int width, int height) void ugrid_clear(UGrid *grid) { - clear_region(grid, grid->top, grid->bot, grid->left, grid->right, + clear_region(grid, 0, grid->height-1, 0, grid->width-1, HLATTRS_INIT); }