diff options
author | glepnir <glephunter@gmail.com> | 2025-02-19 13:40:46 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-02-21 07:45:30 +0800 |
commit | 07785ea9c5595f379f2cac2ce8ffa95244e3d8e3 (patch) | |
tree | c3b1f2224d694097642c40b324934f512a448019 /test/old | |
parent | 99a6cbe5409dc296d6a5597733d92f63d8bca27e (diff) | |
download | rneovim-07785ea9c5595f379f2cac2ce8ffa95244e3d8e3.tar.gz rneovim-07785ea9c5595f379f2cac2ce8ffa95244e3d8e3.tar.bz2 rneovim-07785ea9c5595f379f2cac2ce8ffa95244e3d8e3.zip |
vim-patch:9.1.1121: Enter does not insert newline with "noselect"
Problem: Enter does not insert newline with "noselect" when the pum is
visible (lifepillar)
Solution: When Enter is pressed and no complete-item is selected,
ins_compl_prep returns false, and the edit function continues
processing Enter to insert a new line. (glepnir)
fixes: vim/vim#1653
closes: vim/vim#16653
https://github.com/vim/vim/commit/07f0dbe3aa326fdf4d0f1b1cf7d79df89e91fc6e
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_edit.vim | 17 | ||||
-rw-r--r-- | test/old/testdir/test_ins_complete.vim | 2 | ||||
-rw-r--r-- | test/old/testdir/test_popup.vim | 4 |
3 files changed, 17 insertions, 6 deletions
diff --git a/test/old/testdir/test_edit.vim b/test/old/testdir/test_edit.vim index f9458d69a3..5f1a12e33d 100644 --- a/test/old/testdir/test_edit.vim +++ b/test/old/testdir/test_edit.vim @@ -200,7 +200,7 @@ func Test_edit_07() endif endfu au InsertCharPre <buffer> :call DoIt() - call feedkeys("A\<f5>\<c-p>u\<cr>\<c-l>\<cr>", 'tx') + call feedkeys("A\<f5>\<c-p>u\<C-Y>\<c-l>\<cr>", 'tx') call assert_equal(["Jan\<c-l>",''], 1->getline('$')) %d call setline(1, 'J') @@ -601,7 +601,7 @@ func Test_edit_CTRL_I() call assert_equal([include, 'two', ''], getline(1, '$')) call feedkeys("2ggC\<c-x>\<tab>\<down>\<down>\<cr>\<esc>", 'tnix') call assert_equal([include, 'three', ''], getline(1, '$')) - call feedkeys("2ggC\<c-x>\<tab>\<down>\<down>\<down>\<cr>\<esc>", 'tnix') + call feedkeys("2ggC\<c-x>\<tab>\<down>\<down>\<down>\<C-y>\<esc>", 'tnix') call assert_equal([include, '', ''], getline(1, '$')) bw! endfunc @@ -629,7 +629,7 @@ func Test_edit_CTRL_K() %d call setline(1, 'A') call cursor(1, 1) - call feedkeys("A\<c-x>\<c-k>\<down>\<down>\<down>\<cr>\<esc>", 'tnix') + call feedkeys("A\<c-x>\<c-k>\<down>\<down>\<down>\<C-Y>\<esc>", 'tnix') call assert_equal(['A'], getline(1, '$')) %d call setline(1, 'A') @@ -2309,4 +2309,15 @@ func Test_edit_backspace_smarttab_virtual_text() set smarttab& endfunc +func Test_edit_CAR() + set cot=menu,menuone,noselect + new + + call feedkeys("Shello hero\<CR>h\<C-x>\<C-N>e\<CR>", 'tx') + call assert_equal(['hello hero', 'he', ''], getline(1, '$')) + + bw! + set cot& +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index f4dd2fbd10..7fcc4bae36 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2837,7 +2837,7 @@ func Test_complete_fuzzy_match() call setline(1, ['Text', 'ToText', '']) call cursor(2, 1) call feedkeys("STe\<C-X>\<C-N>x\<CR>\<Esc>0", 'tx!') - call assert_equal('Tex', getline('.')) + call assert_equal('Tex', getline(line('.') - 1)) " test case for nosort option set cot=menuone,menu,noinsert,fuzzy,nosort diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 7f80c60118..41b694860c 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -988,7 +988,7 @@ func Test_popup_complete_backwards() call setline(1, ['Post', 'Port', 'Po']) let expected=['Post', 'Port', 'Port'] call cursor(3,2) - call feedkeys("A\<C-X>". repeat("\<C-P>", 3). "rt\<cr>", 'tx') + call feedkeys("A\<C-X>". repeat("\<C-P>", 3). "rt\<C-Y>", 'tx') call assert_equal(expected, getline(1,'$')) bwipe! endfunc @@ -998,7 +998,7 @@ func Test_popup_complete_backwards_ctrl_p() call setline(1, ['Post', 'Port', 'Po']) let expected=['Post', 'Port', 'Port'] call cursor(3,2) - call feedkeys("A\<C-P>\<C-N>rt\<cr>", 'tx') + call feedkeys("A\<C-P>\<C-N>rt\<C-Y>", 'tx') call assert_equal(expected, getline(1,'$')) bwipe! endfunc |