diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-04 14:53:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 14:53:47 +0800 |
commit | c41e75039f5516a0626d0da69cb15bac7e7fe6de (patch) | |
tree | 2fd42ccbf3afb08e1b05e2c65739ac549cf846e5 /test/functional/editor/completion_spec.lua | |
parent | daa8ac051d9e641cb708af5ae2ffd571f5abbc44 (diff) | |
download | rneovim-c41e75039f5516a0626d0da69cb15bac7e7fe6de.tar.gz rneovim-c41e75039f5516a0626d0da69cb15bac7e7fe6de.tar.bz2 rneovim-c41e75039f5516a0626d0da69cb15bac7e7fe6de.zip |
test: move completion :stopinsert test to completion_spec.lua (#17992)
Diffstat (limited to 'test/functional/editor/completion_spec.lua')
-rw-r--r-- | test/functional/editor/completion_spec.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index 1a0ee54505..e27da0947f 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -1194,6 +1194,47 @@ describe('completion', function() feed('<esc>') 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() source([[ func Complete(findstart, base) abort |