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
2 changed files with 5 additions and 1 deletions

View File

@@ -18845,9 +18845,10 @@ static void f_visualmode(typval_T *argvars, typval_T *rettv, FunPtr fptr)
*/ */
static void f_wildmenumode(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; rettv->vval.v_number = 1;
} }
}
/// "win_findbuf()" function /// "win_findbuf()" function
static void f_win_findbuf(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_win_findbuf(typval_T *argvars, typval_T *rettv, FunPtr fptr)

View File

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