From f2ce31d3dc1c728c33c0910e1a9970f0eb2e3f11 Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Sun, 23 Jul 2023 11:01:51 -0400 Subject: [PATCH] fix(terminal): call validate_cursor() before screen update (#24425) Problem: When the CurSearch highlight group is set, and a search is active and you are listening to the remote UI "win_viewport" events, then typing is very unresponsive, because "win_viewport" is not sent as soon as the character is typed. On the other hand if you refresh the screen on "flush", the screen will scroll with a delay since "win_viewport" comes too late. I estimate this delay be up to one second, but it varies. Solution: Call validate_cursor() before drawing the screen, just like other modes. No tests have been added because only the intermediate state is wrong. --- src/nvim/terminal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 1dacc496b6..56f364bf0a 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -532,6 +532,7 @@ static int terminal_check(VimState *state) } terminal_check_cursor(); + validate_cursor(); if (must_redraw) { update_screen();