mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
fix(snippet): modify base indentation when there's actually whitespace (#29670)
(cherry picked from commit 5fe4ce6678
)
This commit is contained in:

committed by
Christian Clason

parent
24fa65a500
commit
e13f03af85
@@ -61,7 +61,13 @@ describe('vim.snippet', function()
|
||||
end)
|
||||
|
||||
it('adds indentation based on the start of snippet lines', function()
|
||||
local curbuf = api.nvim_get_current_buf()
|
||||
|
||||
test_expand_success({ 'if $1 then', ' $0', 'end' }, { 'if then', ' ', 'end' })
|
||||
|
||||
-- Regression test: #29658
|
||||
api.nvim_buf_set_lines(curbuf, 0, -1, false, {})
|
||||
test_expand_success({ '${1:foo^bar}\n' }, { 'foo^bar', '' })
|
||||
end)
|
||||
|
||||
it('replaces tabs with spaces when expandtab is set', function()
|
||||
|
Reference in New Issue
Block a user