diff options
author | glacambre <code@lacamb.re> | 2019-08-14 19:07:04 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-09-08 20:47:22 +0200 |
commit | 958ca938b44ea7d6f126887f5bec98ee6d2f6f15 (patch) | |
tree | cb5ec1e2adaf7955796c9ad99d70ea4c32a392b2 | |
parent | 288526ae73d07471a484e3f5bd9662b1cecf0884 (diff) | |
download | rneovim-958ca938b44ea7d6f126887f5bec98ee6d2f6f15.tar.gz rneovim-958ca938b44ea7d6f126887f5bec98ee6d2f6f15.tar.bz2 rneovim-958ca938b44ea7d6f126887f5bec98ee6d2f6f15.zip |
ex_getln.c: fix <S-Tab> not triggering pum when wildoptions=pum (#10042)
Some of the logic that was present for <Tab> was missing from <S-Tab>.
Closes https://github.com/neovim/neovim/issues/10042.
-rw-r--r-- | src/nvim/ex_getln.c | 8 | ||||
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 17 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6b4092b5b4..3f7bc45c2e 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1021,9 +1021,11 @@ static int command_line_execute(VimState *state, int key) // <S-Tab> goes to last match, in a clumsy way if (s->c == K_S_TAB && KeyTyped) { - if (nextwild(&s->xpc, WILD_EXPAND_KEEP, 0, s->firstc != '@') == OK - && nextwild(&s->xpc, WILD_PREV, 0, s->firstc != '@') == OK - && nextwild(&s->xpc, WILD_PREV, 0, s->firstc != '@') == OK) { + if (nextwild(&s->xpc, WILD_EXPAND_KEEP, 0, s->firstc != '@') == OK) { + showmatches(&s->xpc, p_wmnu + && ((wim_flags[s->wim_index] & WIM_LIST) == 0)); + nextwild(&s->xpc, WILD_PREV, 0, s->firstc != '@'); + nextwild(&s->xpc, WILD_PREV, 0, s->firstc != '@'); return command_line_changed(s); } } diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 3b4b281c81..ae2136f451 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -574,6 +574,22 @@ describe('ui/ext_popupmenu', function() ]]) feed('<esc>') + -- #10042: make sure shift-tab also triggers the pum + feed(':sign <S-tab>') + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + :sign unplace^ | + ]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}} + feed('<esc>') + -- check positioning with multibyte char in pattern command("e långfile1") command("sp långfile2") @@ -594,6 +610,7 @@ describe('ui/ext_popupmenu', function() items = {{"långfile1", "", "", "" }, {"långfile2", "", "", ""}}, pos = 0, }} + end) end) |