mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
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
07f0dbe3aa
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user