From 59e130b6cacd71326ecc99ca180fd574abc8115c Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 2 Nov 2024 06:54:43 +0100 Subject: fix(inccommand): ensure cursor is where it belongs Problem: Inccommand preview callback may flush inaccurate cmdline cursor position. Solution: Ensure cursor is where it belongs when doing command preview. --- src/nvim/ex_getln.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 389e935557..dda1a18fa6 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2550,6 +2550,9 @@ static bool cmdpreview_may_show(CommandLineState *s) goto end; } + // Cursor may be at the end of the message grid rather than at cmdspos. + // Place it there in case preview callback flushes it. #30696 + cursorcmd(); // Flush now: external cmdline may itself wish to update the screen which is // currently disallowed during cmdpreview(no longer needed in case that changes). cmdline_ui_flush(); -- cgit