aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/edit_spec.lua
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2025-02-19 13:40:46 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-02-21 07:45:30 +0800
commit07785ea9c5595f379f2cac2ce8ffa95244e3d8e3 (patch)
treec3b1f2224d694097642c40b324934f512a448019 /test/functional/legacy/edit_spec.lua
parent99a6cbe5409dc296d6a5597733d92f63d8bca27e (diff)
downloadrneovim-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/functional/legacy/edit_spec.lua')
-rw-r--r--test/functional/legacy/edit_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua
index d2ce80efda..eee232f2c8 100644
--- a/test/functional/legacy/edit_spec.lua
+++ b/test/functional/legacy/edit_spec.lua
@@ -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)