From bf4df2a62928586f5d4478141e80a394068f5c73 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 15 Jun 2022 10:51:25 +0800 Subject: [PATCH] fix(ui): do not call showmode() when setting window height (cherry picked from commit 756e65ae6277323006b7c720ca861e4f28c2a4c2) --- src/nvim/window.c | 1 - test/functional/ui/cmdline_spec.lua | 33 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/nvim/window.c b/src/nvim/window.c index 5a0b3c7119..3438812ef8 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5504,7 +5504,6 @@ void win_setheight_win(int height, win_T *win) msg_row = row; msg_col = 0; redraw_all_later(NOT_VALID); - showmode(); } } diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index 3b273fd229..9beff283b4 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -17,6 +17,8 @@ local function new_screen(opt) [5] = {bold = true, foreground = Screen.colors.SeaGreen4}, [6] = {foreground = Screen.colors.Magenta}, [7] = {bold = true, foreground = Screen.colors.Brown}, + [8] = {background = Screen.colors.LightGrey}, + [9] = {bold = true}, }) return screen end @@ -846,6 +848,37 @@ describe('cmdline redraw', function() 456789^ | ]], unchanged=true} end) + + it('after pressing Ctrl-C in cmdwin in Visual mode #18967', function() + screen:try_resize(40, 10) + command('set cmdwinheight=3') + feed('q:iabcvhh') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {2:[No Name] }| + {1::}^a{8:bc} | + {1:~ }| + {1:~ }| + {3:[Command Line] }| + {9:-- VISUAL --} | + ]]) + feed('') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {2:[No Name] }| + {1::}a{8:bc} | + {1:~ }| + {1:~ }| + {3:[Command Line] }| + :^abc | + ]]) + end) end) describe("cmdline height", function()