mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 17:28:57 +02:00
feat(snippets): re-number tabstops for invalid snippets
This commit is contained in:
parent
025ba33dc3
commit
cf4374867d
1 changed files with 3 additions and 1 deletions
|
@ -23,8 +23,10 @@ end
|
|||
|
||||
-- This function replaces nested placeholders in a snippet with LSP placeholders.
|
||||
function M.snippet_fix(snippet)
|
||||
local nn = 0
|
||||
return M.snippet_replace(snippet, function(placeholder)
|
||||
return "${" .. placeholder.n .. ":" .. M.snippet_preview(placeholder.text) .. "}"
|
||||
nn = nn + 1
|
||||
return "${" .. nn .. ":" .. M.snippet_preview(placeholder.text) .. "}"
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue