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

(cherry picked from commit 608543f8a9)

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
This commit is contained in:
github-actions[bot] 2024-05-27 17:56:05 +02:00 committed by GitHub
parent e98637e8c0
commit 039121f5a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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.