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:
glepnir
2025-02-19 13:40:46 +08:00
committed by zeertzjq
parent 99a6cbe540
commit 07785ea9c5
6 changed files with 55 additions and 10 deletions

View File

@@ -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)