Skip to content

Commit 3980c86

Browse files
girishjichrisbra
authored andcommitted
patch 9.1.1744: tests: Test_skip_wildtrigger_hist_navigation() may fail
Problem: tests: Test_skip_wildtrigger_hist_navigation() may fail (zeertzjq). Solution: Correct test to validate intended behavior (Girish Palya). See vim/vim#18219 (comment) closes: #18243 Signed-off-by: Girish Palya <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent d8ae381 commit 3980c86

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/testdir/test_cmdline.vim

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,25 +5062,30 @@ endfunc
50625062
" Skip wildmenu during history navigation via Up/Down keys
50635063
func Test_skip_wildtrigger_hist_navigation()
50645064
call test_override("char_avail", 1)
5065-
cnoremap <F8> <C-R>=wildtrigger()[-1]<CR>
5066-
set wildmenu
5067-
5068-
call feedkeys(":ech\<F8>\<F4>\<C-B>\"\<CR>", "tx")
5069-
call assert_match('echo*', g:Sline)
5070-
call assert_equal('"echo', @:)
5065+
set wildmenu wildmode=noselect,full
5066+
augroup TestSkipWildtrigger | autocmd!
5067+
autocmd CmdlineChanged : call wildtrigger()
5068+
augroup END
5069+
cnoremap <expr> <Up> wildmenumode() ? "\<C-E>\<Up>" : "\<Up>"
5070+
cnoremap <expr> <Down> wildmenumode() ? "\<C-E>\<Down>" : "\<Down>"
50715071
50725072
call feedkeys(":echom \"foo\"", "tx")
50735073
call feedkeys(":echom \"foobar\"", "tx")
5074-
call feedkeys(":ech\<F8>\<C-E>\<UP>\<C-B>\"\<CR>", "tx")
5074+
5075+
call feedkeys(":ech\<Up>\<C-B>\"\<CR>", "tx")
50755076
call assert_equal('"echom "foobar"', @:)
5076-
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<C-B>\"\<CR>", "tx")
5077+
call feedkeys(":ech\<Up>\<Up>\<C-B>\"\<CR>", "tx")
50775078
call assert_equal('"echom "foo"', @:)
5078-
call feedkeys(":ech\<F8>\<C-E>\<UP>\<UP>\<UP>\<Down>\<C-B>\"\<CR>", "tx")
5079+
call feedkeys(":ech\<Up>\<Up>\<Down>\<C-B>\"\<CR>", "tx")
50795080
call assert_equal('"echom "foobar"', @:)
5081+
call feedkeys(":ech\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", "tx")
5082+
call assert_equal('"ech', @:)
50805083

50815084
call test_override("char_avail", 0)
5082-
set wildmenu&
5083-
cunmap <F8>
5085+
set wildmenu& wildmode& wildoptions&
5086+
augroup TestSkipWildtrigger | autocmd! | augroup END
5087+
cunmap <Up>
5088+
cunmap <Down>
50845089
endfunc
50855090

50865091
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,8 @@ static char *(features[]) =
724724

725725
static int included_patches[] =
726726
{ /* Add new patch number below this line */
727+
/**/
728+
1744,
727729
/**/
728730
1743,
729731
/**/

0 commit comments

Comments
 (0)