From d19ff73b39a9299db4a6947709e01e598ee60b4a Mon Sep 17 00:00:00 2001 From: Jit Yao Yap Date: Sun, 2 Jun 2019 23:12:10 +0200 Subject: [PATCH 1/3] Fix multiple c_CTRL-D showing statusline --- src/nvim/ex_getln.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index ce46408872..3bfda1f9f0 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -656,10 +656,13 @@ static int command_line_execute(VimState *state, int key) redrawcmd(); save_p_ls = -1; wild_menu_showing = 0; - } else { + // don't redraw statusline if WM_LIST is showing + } else if (wild_menu_showing != WM_LIST) { win_redraw_last_status(topframe); wild_menu_showing = 0; // must be before redraw_statuslines #8385 redraw_statuslines(); + } else { + wild_menu_showing = 0; } KeyTyped = skt; if (ccline.input_fn) { From c96aed2ba76f8a5e6ad764f59a074696bc250fca Mon Sep 17 00:00:00 2001 From: Jit Yao Yap Date: Sun, 2 Jun 2019 23:35:04 +0200 Subject: [PATCH 2/3] Add test --- test/functional/ui/wildmode_spec.lua | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 75b5ea9476..2266939a53 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -248,6 +248,42 @@ describe("'wildmenu'", function() | ]]) end) + + it('multiple renders correctly', function() + command('set laststatus=2') + command('set display+=msgsep') + feed(':set wildm') + feed('') + screen:expect([[ + | + ~ | + ~ | + | + :set wildm | + wildmenu wildmode | + :set wildm^ | + ]]) + feed('') + screen:expect([[ + | + | + :set wildm | + wildmenu wildmode | + :set wildm | + wildmenu wildmode | + :set wildm^ | + ]]) + feed('') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + ~ | + [No Name] | + | + ]]) + end) end) describe('command line completion', function() From 3d24bb48e71315546da0cb4518fe9229cac402f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 3 Jun 2019 11:23:10 +0200 Subject: [PATCH 3/3] test: don't detach screen just to change the size --- test/functional/ui/messages_spec.lua | 7 ++----- test/functional/ui/wildmode_spec.lua | 17 ++++------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 42a70c9f6a..7d21f40ce9 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -705,11 +705,8 @@ describe('ui/ext_messages', function() end) it('wildmode=list', function() - local default_attr = screen:get_default_attr_ids() - screen:detach() - screen = Screen.new(25, 7) - screen:attach({rgb=true, ext_messages=true}) - screen:set_default_attr_ids(default_attr) + screen:try_resize(25, 7) + screen:set_option('ext_popupmenu', false) command('set wildmenu wildmode=list') feed(':set wildm') diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 2266939a53..914256224f 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -15,9 +15,6 @@ describe("'wildmenu'", function() screen = Screen.new(25, 5) screen:attach() end) - after_each(function() - screen:detach() - end) -- expect the screen stayed unchanged some time after first seen success local function expect_stay_unchanged(args) @@ -170,9 +167,7 @@ describe("'wildmenu'", function() it('wildmode=list,full and display+=msgsep interaction #10092', function() -- Need more than 5 rows, else tabline is covered and will be redrawn. - screen:detach() - screen = Screen.new(25, 7) - screen:attach() + screen:try_resize(25, 7) command('set display+=msgsep') command('set wildmenu wildmode=list,full') @@ -211,9 +206,7 @@ describe("'wildmenu'", function() it('wildmode=list,full and display-=msgsep interaction', function() -- Need more than 5 rows, else tabline is covered and will be redrawn. - screen:detach() - screen = Screen.new(25, 7) - screen:attach() + screen:try_resize(25, 7) command('set display-=msgsep') command('set wildmenu wildmode=list,full') @@ -250,6 +243,8 @@ describe("'wildmenu'", function() end) it('multiple renders correctly', function() + screen:try_resize(25, 7) + command('set laststatus=2') command('set display+=msgsep') feed(':set wildm') @@ -360,10 +355,6 @@ describe('ui/ext_wildmenu', function() screen:attach({rgb=true, ext_wildmenu=true}) end) - after_each(function() - screen:detach() - end) - it('works with :sign ', function() local expected = { 'define',