feat(cmp): create undo point right before confirming a completion

This commit is contained in:
Folke Lemaitre
2024-05-18 23:28:35 +02:00
parent 96aa4b8877
commit 673975ebbe
2 changed files with 17 additions and 1 deletions

View File

@ -190,4 +190,12 @@ function M.dedup(list)
return ret
end
M.CREATE_UNDO = vim.api.nvim_replace_termcodes("<c-G>u", true, true, true)
function M.create_undo()
if vim.api.nvim_get_mode().mode == "i" then
dd("undo")
vim.api.nvim_feedkeys(M.CREATE_UNDO, "n", false)
end
end
return M