fix(lsp): handle adjacent snippet tabstops

This commit is contained in:
Maria José Solano
2024-01-03 20:05:03 -08:00
committed by Lewis Russell
parent 43661a0abf
commit 0e9a33572d
2 changed files with 47 additions and 2 deletions

View File

@@ -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)