mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 04:18:18 +00:00
test: move completion :stopinsert test to completion_spec.lua (#17992)
This commit is contained in:
@@ -1194,6 +1194,47 @@ describe('completion', function()
|
|||||||
feed('<esc>')
|
feed('<esc>')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('is stopped by :stopinsert from timer #12976', function()
|
||||||
|
screen:try_resize(32,14)
|
||||||
|
command([[call setline(1, ['hello', 'hullo', 'heeee', ''])]])
|
||||||
|
feed('Gah<c-x><c-n>')
|
||||||
|
screen:expect([[
|
||||||
|
hello |
|
||||||
|
hullo |
|
||||||
|
heeee |
|
||||||
|
hello^ |
|
||||||
|
{2:hello }{0: }|
|
||||||
|
{1:hullo }{0: }|
|
||||||
|
{1:heeee }{0: }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{3:-- }{4:match 1 of 3} |
|
||||||
|
]])
|
||||||
|
command([[call timer_start(100, { -> execute('stopinsert') })]])
|
||||||
|
helpers.sleep(200)
|
||||||
|
feed('k') -- cursor should move up in Normal mode
|
||||||
|
screen:expect([[
|
||||||
|
hello |
|
||||||
|
hullo |
|
||||||
|
heee^e |
|
||||||
|
hello |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('does not crash if text is changed by first call to complete function #17489', function()
|
it('does not crash if text is changed by first call to complete function #17489', function()
|
||||||
source([[
|
source([[
|
||||||
func Complete(findstart, base) abort
|
func Complete(findstart, base) abort
|
||||||
|
@@ -2321,47 +2321,6 @@ describe('builtin popupmenu', function()
|
|||||||
assert_alive()
|
assert_alive()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('is closed by :stopinsert from timer #12976', function()
|
|
||||||
screen:try_resize(32,14)
|
|
||||||
command([[call setline(1, ['hello', 'hullo', 'heeee', ''])]])
|
|
||||||
feed('Gah<c-x><c-n>')
|
|
||||||
screen:expect([[
|
|
||||||
hello |
|
|
||||||
hullo |
|
|
||||||
heeee |
|
|
||||||
hello^ |
|
|
||||||
{s:hello }{1: }|
|
|
||||||
{n:hullo }{1: }|
|
|
||||||
{n:heeee }{1: }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{2:-- }{5:match 1 of 3} |
|
|
||||||
]])
|
|
||||||
command([[call timer_start(100, { -> execute('stopinsert') })]])
|
|
||||||
helpers.sleep(200)
|
|
||||||
feed('k') -- cursor should move up in Normal mode
|
|
||||||
screen:expect([[
|
|
||||||
hello |
|
|
||||||
hullo |
|
|
||||||
heee^e |
|
|
||||||
hello |
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
{1:~ }|
|
|
||||||
|
|
|
||||||
]])
|
|
||||||
end)
|
|
||||||
|
|
||||||
it('truncates double-width character correctly when there is no scrollbar', function()
|
it('truncates double-width character correctly when there is no scrollbar', function()
|
||||||
screen:try_resize(32,8)
|
screen:try_resize(32,8)
|
||||||
command('set completeopt+=menuone,noselect')
|
command('set completeopt+=menuone,noselect')
|
||||||
|
Reference in New Issue
Block a user