aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/snippet_spec.lua
diff options
context:
space:
mode:
authorMaria José Solano <majosolano99@gmail.com>2024-07-16 10:30:22 -0700
committerGitHub <noreply@github.com>2024-07-16 19:30:22 +0200
commit5fe4ce6678c0b531487e4d9836774464b5ec56ed (patch)
treef8c87d31fca1abdd71d14ad383ed3d9b635e464f /test/functional/lua/snippet_spec.lua
parent118ae7e5ed6cfab6a49ec70c21da2b850161289c (diff)
downloadrneovim-5fe4ce6678c0b531487e4d9836774464b5ec56ed.tar.gz
rneovim-5fe4ce6678c0b531487e4d9836774464b5ec56ed.tar.bz2
rneovim-5fe4ce6678c0b531487e4d9836774464b5ec56ed.zip
fix(snippet): modify base indentation when there's actually whitespace (#29670)
Diffstat (limited to 'test/functional/lua/snippet_spec.lua')
-rw-r--r--test/functional/lua/snippet_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua
index bca0a59cb4..eb2f17216c 100644
--- a/test/functional/lua/snippet_spec.lua
+++ b/test/functional/lua/snippet_spec.lua
@@ -58,7 +58,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()