fix(snippet): use <cmd>call cursor() for visual range

Problem:  Change applied in d3e495ce uses a byte-offset where a virtual
          column is expected.
Solution: Set the cursor directly through a <Cmd> mapping, while making
          sure the commands are ordered correctly by adding them to the
          type-ahead buffer.
This commit is contained in:
Luuk van Baal
2025-04-22 21:35:10 +02:00
committed by luukvbaal
parent 8d68dbf906
commit 019b2050e1
2 changed files with 16 additions and 16 deletions

View File

@@ -307,4 +307,10 @@ describe('vim.snippet', function()
]]
)
end)
it('correct visual selection with multi-byte text', function()
test_expand_success({ 'function(${1:var})' }, { '口口function(var)' }, nil, '口口')
feed('foo')
eq({ '口口function(foo)' }, buf_lines(0))
end)
end)