diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-02-25 02:05:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 11:05:37 +0100 |
commit | 0fcbda59871ebc5fc91cac7fa430a4a93f6698c2 (patch) | |
tree | 116290374a705f2acb3cee2d0e179021d14a04fa /test/functional/lua/snippet_spec.lua | |
parent | c651a0f643e7bd34eb740069a7b5b8c9f8759ecc (diff) | |
download | rneovim-0fcbda59871ebc5fc91cac7fa430a4a93f6698c2.tar.gz rneovim-0fcbda59871ebc5fc91cac7fa430a4a93f6698c2.tar.bz2 rneovim-0fcbda59871ebc5fc91cac7fa430a4a93f6698c2.zip |
fix(lsp): add snippet regression test (#27618)
Diffstat (limited to 'test/functional/lua/snippet_spec.lua')
-rw-r--r-- | test/functional/lua/snippet_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua index 6f76f46e75..e981bc6261 100644 --- a/test/functional/lua/snippet_spec.lua +++ b/test/functional/lua/snippet_spec.lua @@ -228,4 +228,16 @@ describe('vim.snippet', function() feed(',2') eq({ 'for i=1,10,2 do', '\t', 'end' }, buf_lines(0)) end) + + it('updates snippet state when built-in completion menu is visible', function() + test_expand_success({ '$1 = function($2)\n$3\nend' }, { ' = function()', '', 'end' }) + -- Show the completion menu. + feed('<C-n>') + -- Make sure no item is selected. + feed('<C-p>') + -- Jump forward (the 2nd tabstop). + exec_lua('vim.snippet.jump(1)') + feed('foo') + eq({ ' = function(foo)', '', 'end' }, buf_lines(0)) + end) end) |