From e4c2ff2da4fb1986e0cd88e6eea9d49ddaec9817 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 30 Jun 2022 15:55:38 +0800 Subject: vim-patch:8.0.1574: show cursor in wrong place when using popup menu Problem: Show cursor in wrong place when using popup menu. (Wei Zhang) Solution: Force updating the cursor position. Fix skipping over unused entries. https://github.com/vim/vim/commit/987723e084660290270b3c3d943eb13bd828d5da --- src/nvim/screen.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/nvim/screen.c') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 78b0d6b841..c2a88bb4a6 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5757,12 +5757,17 @@ static void linecopy(ScreenGrid *grid, int to, int from, int col, int width) width * sizeof(sattr_T)); } -/* - * Set cursor to its position in the current window. - */ +/// Set cursor to its position in the current window. void setcursor(void) { - if (redrawing()) { + setcursor_mayforce(false); +} + +/// Set cursor to its position in the current window. +/// @param force when true, also when not redrawing. +void setcursor_mayforce(bool force) +{ + if (force || redrawing()) { validate_cursor(); ScreenGrid *grid = &curwin->w_grid; -- cgit