aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
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 /runtime/lua/vim
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 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/snippet.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua
index a880bf0197..af7e3c6d33 100644
--- a/runtime/lua/vim/snippet.lua
+++ b/runtime/lua/vim/snippet.lua
@@ -514,7 +514,7 @@ function M.expand(input)
local snippet_lines = text_to_lines(snippet_text)
-- Get the base indentation based on the current line and the last line of the snippet.
if #snippet_lines > 0 then
- base_indent = base_indent .. (snippet_lines[#snippet_lines]:match('(^%s*)%S') or '') --- @type string
+ base_indent = base_indent .. (snippet_lines[#snippet_lines]:match('(^%s+)%S') or '') --- @type string
end
local shiftwidth = vim.fn.shiftwidth()