diff options
Diffstat (limited to 'test/functional')
| -rw-r--r-- | test/functional/editor/completion_spec.lua | 10 | ||||
| -rw-r--r-- | test/functional/legacy/edit_spec.lua | 24 |
2 files changed, 30 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) 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) |