diff options
| author | glepnir <glephunter@gmail.com> | 2025-02-19 13:40:46 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2025-02-21 07:45:30 +0800 |
| commit | 07785ea9c5595f379f2cac2ce8ffa95244e3d8e3 (patch) | |
| tree | c3b1f2224d694097642c40b324934f512a448019 /test/functional/editor/completion_spec.lua | |
| parent | 99a6cbe5409dc296d6a5597733d92f63d8bca27e (diff) | |
| download | rneovim-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/editor/completion_spec.lua')
| -rw-r--r-- | test/functional/editor/completion_spec.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index 7c68de272b..fdf6917b53 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -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) |