feat(snippet): support multiple sessions #29340

This commit is contained in:
Maria Solano
2026-04-10 07:08:10 -07:00
committed by GitHub
parent 45f50d238a
commit c1c2648284
3 changed files with 23 additions and 5 deletions

View File

@@ -403,4 +403,18 @@ describe('vim.snippet', function()
feed('foo')
eq({ '口口function(foo)' }, buf_lines(0))
end)
it('supports multiple snippet sessions', function()
test_expand_success({ 'func $1($3) {', ' $2', '}' }, { 'func () {', ' ', '}' })
feed('foo<Tab>')
test_expand_success({ 'var x = $1 + $2' }, { 'func foo() {', ' var x = + ', '}' })
feed('a<Tab>b')
feed('<Tab><Tab>a, b')
eq({ 'func foo(a, b) {', ' var x = a + b', '}' }, buf_lines(0))
end)
end)