mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
feat(snip): add undo breakpoints
This commit is contained in:
@@ -18,6 +18,7 @@ local default_config = {
|
||||
},
|
||||
snippets = {
|
||||
enable = true,
|
||||
add_undo_breakpoints = true,
|
||||
modules = { -- enable modules from ./snippets
|
||||
'letters',
|
||||
'math',
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user