aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ex_getln.c5
-rw-r--r--test/functional/ui/cmdline_spec.lua23
2 files changed, 25 insertions, 3 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 303337ae98..d482f9851e 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -767,7 +767,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
}
setmouse();
- ui_cursor_shape(); // may show different cursor shape
+ setcursor();
TryState tstate;
Error err = ERROR_INIT;
@@ -927,7 +927,6 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
}
may_trigger_modechanged();
setmouse();
- ui_cursor_shape(); // may show different cursor shape
sb_text_end_cmdline();
theend:
@@ -3859,7 +3858,6 @@ void cursorcmd(void)
if (ccline.redraw_state < kCmdRedrawPos) {
ccline.redraw_state = kCmdRedrawPos;
}
- setcursor();
return;
}
@@ -4553,6 +4551,7 @@ static int open_cmdwin(void)
State = save_State;
may_trigger_modechanged();
setmouse();
+ setcursor();
return cmdwin_result;
}
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 0eb5770819..3b5b488982 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -824,6 +824,29 @@ local function test_cmdline(linegrid)
|
]])
end)
+
+ it('does not move cursor to curwin #20309', function()
+ local win = api.nvim_get_current_win()
+ command('norm icmdlinewin')
+ command('new')
+ command('norm icurwin')
+ feed(':')
+ api.nvim_win_set_cursor(win, { 1, 7 })
+ screen:expect {
+ grid = [[
+ curwin |
+ {3:[No Name] [+] }|
+ cmdline^win |
+ {2:[No Name] [+] }|
+ |
+ ]],
+ cmdline = { {
+ content = { { '' } },
+ firstc = ':',
+ pos = 0,
+ } },
+ }
+ end)
end
-- the representation of cmdline and cmdline_block contents changed with ext_linegrid