mirror of
https://github.com/neovim/neovim.git
synced 2025-11-21 09:36:29 +00: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:
@@ -92,4 +92,28 @@ describe('edit', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
-- oldtest: Test_edit_CAR()
|
||||
it('insert a newline when pressing Enter, even if the pum is visible', function()
|
||||
local screen = Screen.new(10, 6)
|
||||
command('set cot=menu,menuone,noselect')
|
||||
feed('Shello hero<CR>h<C-X><C-N>e')
|
||||
screen:expect([[
|
||||
hello hero |
|
||||
he^ |
|
||||
{4:hello }|
|
||||
{4:hero }|
|
||||
{1:~ }|
|
||||
{5:--} |
|
||||
]])
|
||||
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
hello hero |
|
||||
he |
|
||||
^ |
|
||||
{1:~ }|*2
|
||||
{5:-- INSERT --}|
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user