Merge pull request #10107 from gelguy/c_ctrl_d

Fix multiple <C-D> showing statusline on previous completion list
This commit is contained in:
Björn Linse 2019-06-03 12:10:28 +02:00 committed by GitHub
commit 3273e39db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 19 deletions

View File

@ -656,10 +656,13 @@ static int command_line_execute(VimState *state, int key)
redrawcmd(); redrawcmd();
save_p_ls = -1; save_p_ls = -1;
wild_menu_showing = 0; 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); win_redraw_last_status(topframe);
wild_menu_showing = 0; // must be before redraw_statuslines #8385 wild_menu_showing = 0; // must be before redraw_statuslines #8385
redraw_statuslines(); redraw_statuslines();
} else {
wild_menu_showing = 0;
} }
KeyTyped = skt; KeyTyped = skt;
if (ccline.input_fn) { if (ccline.input_fn) {

View File

@ -705,11 +705,8 @@ describe('ui/ext_messages', function()
end) end)
it('wildmode=list', function() it('wildmode=list', function()
local default_attr = screen:get_default_attr_ids() screen:try_resize(25, 7)
screen:detach() screen:set_option('ext_popupmenu', false)
screen = Screen.new(25, 7)
screen:attach({rgb=true, ext_messages=true})
screen:set_default_attr_ids(default_attr)
command('set wildmenu wildmode=list') command('set wildmenu wildmode=list')
feed(':set wildm<tab>') feed(':set wildm<tab>')

View File

@ -15,9 +15,6 @@ describe("'wildmenu'", function()
screen = Screen.new(25, 5) screen = Screen.new(25, 5)
screen:attach() screen:attach()
end) end)
after_each(function()
screen:detach()
end)
-- expect the screen stayed unchanged some time after first seen success -- expect the screen stayed unchanged some time after first seen success
local function expect_stay_unchanged(args) local function expect_stay_unchanged(args)
@ -170,9 +167,7 @@ describe("'wildmenu'", function()
it('wildmode=list,full and display+=msgsep interaction #10092', function() it('wildmode=list,full and display+=msgsep interaction #10092', function()
-- Need more than 5 rows, else tabline is covered and will be redrawn. -- Need more than 5 rows, else tabline is covered and will be redrawn.
screen:detach() screen:try_resize(25, 7)
screen = Screen.new(25, 7)
screen:attach()
command('set display+=msgsep') command('set display+=msgsep')
command('set wildmenu wildmode=list,full') command('set wildmenu wildmode=list,full')
@ -211,9 +206,7 @@ describe("'wildmenu'", function()
it('wildmode=list,full and display-=msgsep interaction', function() it('wildmode=list,full and display-=msgsep interaction', function()
-- Need more than 5 rows, else tabline is covered and will be redrawn. -- Need more than 5 rows, else tabline is covered and will be redrawn.
screen:detach() screen:try_resize(25, 7)
screen = Screen.new(25, 7)
screen:attach()
command('set display-=msgsep') command('set display-=msgsep')
command('set wildmenu wildmode=list,full') command('set wildmenu wildmode=list,full')
@ -248,6 +241,44 @@ describe("'wildmenu'", function()
| |
]]) ]])
end) end)
it('multiple <C-D> renders correctly', function()
screen:try_resize(25, 7)
command('set laststatus=2')
command('set display+=msgsep')
feed(':set wildm')
feed('<c-d>')
screen:expect([[
|
~ |
~ |
|
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<c-d>')
screen:expect([[
|
|
:set wildm |
wildmenu wildmode |
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<Esc>')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
[No Name] |
|
]])
end)
end) end)
describe('command line completion', function() describe('command line completion', function()
@ -324,10 +355,6 @@ describe('ui/ext_wildmenu', function()
screen:attach({rgb=true, ext_wildmenu=true}) screen:attach({rgb=true, ext_wildmenu=true})
end) end)
after_each(function()
screen:detach()
end)
it('works with :sign <tab>', function() it('works with :sign <tab>', function()
local expected = { local expected = {
'define', 'define',