feat(snip): add undo breakpoints

This commit is contained in:
arne314
2025-06-11 17:00:35 +02:00
parent 3e8a45d1ca
commit 96651972b0
2 changed files with 10 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ local default_config = {
},
snippets = {
enable = true,
add_undo_breakpoints = true,
modules = { -- enable modules from ./snippets
'letters',
'math',

View File

@@ -167,6 +167,15 @@ function M.setup()
end
end
luasnip.add_snippets('typst', autosnippets)
if cfg.add_undo_breakpoints then
vim.api.nvim_create_autocmd('User', {
pattern = 'LuasnipPreExpand',
callback = function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-g>u', true, false, true), 'n', false)
end,
})
end
end
end