fix(snippet): cancel snippet session when leaving the buffer (#29031)

This commit is contained in:
Maria José Solano
2024-05-27 08:18:10 -07:00
committed by GitHub
parent 292365fa1b
commit 608543f8a9

View File

@ -395,6 +395,15 @@ local function setup_autocmds(bufnr)
end
end,
})
vim.api.nvim_create_autocmd('BufLeave', {
group = snippet_group,
desc = 'Stop the snippet session when leaving the buffer',
buffer = bufnr,
callback = function()
M.stop()
end,
})
end
--- Expands the given snippet text.