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:
@@ -506,19 +506,21 @@ describe('completion', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('Enter selects original text after adding leader', function()
|
||||
it('Enter selects original text after adding leader and insert newline', function()
|
||||
feed('iJ<C-x><C-u>')
|
||||
poke_eventloop()
|
||||
feed('u')
|
||||
poke_eventloop()
|
||||
feed('<CR>')
|
||||
expect('Ju')
|
||||
expect([[Ju
|
||||
]])
|
||||
feed('<Esc>')
|
||||
poke_eventloop()
|
||||
-- The behavior should be the same when completion has been interrupted,
|
||||
-- which can happen interactively if the completion function is slow.
|
||||
feed('SJ<C-x><C-u>u<CR>')
|
||||
expect('Ju')
|
||||
feed('ggVGSJ<C-x><C-u>u<CR>')
|
||||
expect([[Ju
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user