mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
vim-patch:9.1.1738: cmdline-autocompletion breaks history navigation
Problem: cmdline-autocompletion breaks history navigation (ddad431)
Solution: Support history navigation in cmdline autocompletion (Girish
Palya)
Up/Down arrows support history navigation when using wildtrigger()
fixes: vim/vim#18207
closes: vim/vim#18219
708ab7f5fb
Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
@@ -4986,4 +4986,28 @@ func Test_CmdlineLeave_vchar_keys()
|
||||
unlet g:leave_key
|
||||
endfunc
|
||||
|
||||
" Skip wildmenu during history navigation via Up/Down keys
|
||||
func Test_skip_wildtrigger_hist_navigation()
|
||||
call Ntest_override("char_avail", 1)
|
||||
cnoremap <F8> <C-R>=wildtrigger()[-1]<CR>
|
||||
set wildmenu
|
||||
|
||||
call feedkeys(":ech\<F8>\<F4>\<C-B>\"\<CR>", "tx")
|
||||
call assert_match('echo*', g:Sline)
|
||||
call assert_equal('"echo', @:)
|
||||
|
||||
call feedkeys(":echom \"foo\"", "tx")
|
||||
call feedkeys(":echom \"foobar\"", "tx")
|
||||
call feedkeys(":ech\<F8>\<C-E>\<UP>\<C-B>\"\<CR>", "tx")
|
||||
call assert_equal('"echom "foobar"', @:)
|
||||
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<C-B>\"\<CR>", "tx")
|
||||
call assert_equal('"echom "foo"', @:)
|
||||
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<Down>\<C-B>\"\<CR>", "tx")
|
||||
call assert_equal('"echom "foobar"', @:)
|
||||
|
||||
call Ntest_override("char_avail", 0)
|
||||
set wildmenu&
|
||||
cunmap <F8>
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user