From 02f126a2758e834a7e9dfbae0ede48bf8b90512f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 2 Sep 2019 16:44:08 -0400 Subject: vim-patch:8.0.1806: InsertCharPre causes problems for autocomplete Problem: InsertCharPre causes problems for autocomplete. (Lifepillar) Solution: Check for InsertCharPre before calling vpeekc(). (Christian Brabandt, closes vim/vim#2876) https://github.com/vim/vim/commit/39de95257714b76ccd845d081cff57830a79b488 --- src/nvim/testdir/test_popup.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 162df4b76e..53df30bb19 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -746,6 +746,36 @@ func Test_popup_complete_backwards() bwipe! endfunc +fun! Test_complete_o_tab() + throw 'skipped: Nvim does not support test_override()' + let s:o_char_pressed = 0 + + fun! s:act_on_text_changed() + if s:o_char_pressed + let s:o_char_pressed = 0 + call feedkeys("\\", 'i') + endif + endf + + set completeopt=menu,noselect + new + imap pumvisible() ? "\" : "X" + autocmd! InsertCharPre let s:o_char_pressed = (v:char ==# 'o') + autocmd! TextChangedI call act_on_text_changed() + call setline(1, ['hoard', 'hoax', 'hoarse', '']) + let l:expected = ['hoard', 'hoax', 'hoarse', 'hoax', 'hoax'] + call cursor(4,1) + call test_override("char_avail", 1) + call feedkeys("Ahoa\\\\", 'tx') + call feedkeys("oho\\\\", 'tx') + call assert_equal(l:expected, getline(1,'$')) + + call test_override("char_avail", 0) + bwipe! + set completeopt& + delfunc s:act_on_text_changed +endf + func Test_popup_complete_info_01() new inoremap =complete_info().mode -- cgit From c0cb7585cc6b9d408811b95bb5462789f5ca0207 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 2 Sep 2019 19:05:33 -0400 Subject: vim-patch:8.1.0046: loading a session file fails if 'winheight' is big Problem: Loading a session file fails if 'winheight' is a big number. Solution: Set 'minwinheight' to zero at first. Don't give an error when setting 'minwinheight' while 'winheight' is a big number. Fix using vertical splits. Fix setting 'minwinwidth'. (closes vim/vim#2970) https://github.com/vim/vim/commit/1c3c10492a291270fa89b3c8df11828792f927d3 --- src/nvim/testdir/test_mksession.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 0e56ed2ff3..b7169444d1 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -106,13 +106,22 @@ endfunc func Test_mksession_winheight() new - set winheight=10 winminheight=2 + set winheight=10 + set winminheight=2 mksession! Xtest_mks.out source Xtest_mks.out call delete('Xtest_mks.out') endfunc +func Test_mksession_large_winheight() + set winheight=999 + mksession! Xtest_mks_winheight.out + set winheight& + source Xtest_mks_winheight.out + call delete('Xtest_mks_winheight.out') +endfunc + " Verify that arglist is stored correctly to the session file. func Test_mksession_arglist() argdel * -- cgit From 7199f0b3b3e31c1c3b96d17d6f1f959d1db5ce76 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 3 Sep 2019 00:05:23 -0400 Subject: vim-patch:8.1.1063: insufficient testing for wildmenu completion Problem: Insufficient testing for wildmenu completion. Solution: Extend the test case. (Dominique Pelle, closes vim/vim#4182) https://github.com/vim/vim/commit/37db642083398da7d04ed45767cc46daf40bf72b --- src/nvim/testdir/test_cmdline.vim | 44 ++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index f43ea0e923..e6aafd964b 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -15,14 +15,48 @@ func Test_complete_list() endfunc func Test_complete_wildmenu() - call writefile(['testfile1'], 'Xtestfile1') - call writefile(['testfile2'], 'Xtestfile2') + call mkdir('Xdir1/Xdir2', 'p') + call writefile(['testfile1'], 'Xdir1/Xtestfile1') + call writefile(['testfile2'], 'Xdir1/Xtestfile2') + call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3') + call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4') set wildmenu - call feedkeys(":e Xtestf\t\t\r", "tx") + + " Pressing completes, and moves to next files when pressing again. + call feedkeys(":e Xdir1/\\\", 'tx') + call assert_equal('testfile1', getline(1)) + call feedkeys(":e Xdir1/\\\\", 'tx') + call assert_equal('testfile2', getline(1)) + + " is like but begin with the last match and then go to + " previous. + call feedkeys(":e Xdir1/Xtest\\", 'tx') call assert_equal('testfile2', getline(1)) + call feedkeys(":e Xdir1/Xtest\\\", 'tx') + call assert_equal('testfile1', getline(1)) - call delete('Xtestfile1') - call delete('Xtestfile2') + " / to move to previous/next file. + call feedkeys(":e Xdir1/\\\", 'tx') + call assert_equal('testfile1', getline(1)) + call feedkeys(":e Xdir1/\\\\", 'tx') + call assert_equal('testfile2', getline(1)) + call feedkeys(":e Xdir1/\\\\\", 'tx') + call assert_equal('testfile1', getline(1)) + + " / to go up/down directories. + call feedkeys(":e Xdir1/\\\", 'tx') + call assert_equal('testfile3', getline(1)) + call feedkeys(":e Xdir1/\\\\\", 'tx') + call assert_equal('testfile1', getline(1)) + + " cleanup + %bwipe + call delete('Xdir1/Xdir2/Xtestfile4') + call delete('Xdir1/Xdir2/Xtestfile3') + call delete('Xdir1/Xtestfile2') + call delete('Xdir1/Xtestfile1') + call delete('Xdir1/Xdir2', 'd') + call delete('Xdir1', 'd') set nowildmenu endfunc -- cgit