From 4b6caa913c3ee08ce30eef1f4c6cfbe1873f3569 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Wed, 30 Apr 2025 13:51:14 +0200 Subject: [PATCH] fix(cmdline): do not move UI cursor when entering cmdline #33729 Problem: Cursor is still moved to curwin when entering cmdline (after d41b8d47). Solution: Remove call to `setcursor()`. (cherry picked from commit 0015a105ca7c18e82689e2d43de2569cca63ab87) --- src/nvim/ex_getln.c | 1 - test/functional/ui/messages_spec.lua | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 22b5d7accd..fd72336198 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -792,7 +792,6 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear } setmouse(); - setcursor(); Error err = ERROR_INIT; char firstcbuf[2]; diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 96e67982ac..466ab057fe 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -125,8 +125,8 @@ describe('ui/ext_messages', function() feed(':%s/i/X/gc') screen:expect({ grid = [[ - l{2:^i}ne 1 | - l{10:i}ne 2 | + l{2:i}ne 1 | + l{10:i}ne ^2 | {1:~ }|*3 ]], cmdline = { @@ -1348,7 +1348,7 @@ stack traceback: feed('z=') screen:expect({ grid = [[ - {100:^helllo} | + {100:helll^o} | {1:~ }|*4 ]], cmdline = { @@ -1371,7 +1371,7 @@ stack traceback: feed('1') screen:expect({ grid = [[ - {100:^helllo} | + {100:helll^o} | {1:~ }|*4 ]], cmdline = {