aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/snippet_spec.lua
diff options
context:
space:
mode:
authorMaria José Solano <majosolano99@gmail.com>2024-01-03 20:05:03 -0800
committerLewis Russell <me@lewisr.dev>2024-02-05 15:03:46 +0000
commit0e9a33572dc752463a0f5ad8a08a2c494d7a42e1 (patch)
treeb0983d66b2e149b9c57ca6c13d0c6182ce686ef5 /test/functional/lua/snippet_spec.lua
parent43661a0abf6e1698516d78e6dbf9dfdbf76720bc (diff)
downloadrneovim-0e9a33572dc752463a0f5ad8a08a2c494d7a42e1.tar.gz
rneovim-0e9a33572dc752463a0f5ad8a08a2c494d7a42e1.tar.bz2
rneovim-0e9a33572dc752463a0f5ad8a08a2c494d7a42e1.zip
fix(lsp): handle adjacent snippet tabstops
Diffstat (limited to 'test/functional/lua/snippet_spec.lua')
-rw-r--r--test/functional/lua/snippet_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua
index f86d73a82b..6f76f46e75 100644
--- a/test/functional/lua/snippet_spec.lua
+++ b/test/functional/lua/snippet_spec.lua
@@ -216,4 +216,16 @@ describe('vim.snippet', function()
feed('foo')
eq({ 'public function foo() {', '\t', '}' }, buf_lines(0))
end)
+
+ it('jumps through adjacent tabstops', function()
+ test_expand_success(
+ { 'for i=1,${1:to}${2:,step} do\n\t$3\nend' },
+ { 'for i=1,to,step do', '\t', 'end' }
+ )
+ feed('10')
+ feed('<Tab>')
+ poke_eventloop()
+ feed(',2')
+ eq({ 'for i=1,10,2 do', '\t', 'end' }, buf_lines(0))
+ end)
end)