Merge pull request #11115 from bfredl/wildmenumode

cmdline: wildmenumode() should be true with wildoptions+=pum
This commit is contained in:
Björn Linse 2019-09-29 15:55:18 +02:00 committed by GitHub
commit ce637d0ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -18845,8 +18845,9 @@ static void f_visualmode(typval_T *argvars, typval_T *rettv, FunPtr fptr)
*/
static void f_wildmenumode(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
if (wild_menu_showing)
if (wild_menu_showing || ((State & CMDLINE) && pum_visible())) {
rettv->vval.v_number = 1;
}
}
/// "win_findbuf()" function

View File

@ -516,6 +516,7 @@ describe('ui/ext_popupmenu', function()
{1:~ }|
:sign ^ |
]])
eq(0, funcs.wildmenumode())
feed('<tab>')
screen:expect{grid=[[
@ -530,6 +531,7 @@ describe('ui/ext_popupmenu', function()
{1:~ }|
:sign define^ |
]], popupmenu={items=wild_expected, pos=0, anchor={1, 9, 6}}}
eq(1, funcs.wildmenumode())
feed('<left>')
screen:expect{grid=[[
@ -589,6 +591,7 @@ describe('ui/ext_popupmenu', function()
:sign unplace^ |
]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}}
feed('<esc>')
eq(0, funcs.wildmenumode())
-- check positioning with multibyte char in pattern
command("e långfile1")