feat: lua autocmd (#1707)

This commit is contained in:
Dave Lage
2022-04-22 10:20:59 -04:00
committed by GitHub
parent cc1a3440f9
commit 697ee7aa70
4 changed files with 47 additions and 40 deletions

View File

@@ -155,13 +155,15 @@ git.bcommits = function(opts)
vim.bo.filetype = ft
vim.cmd "diffthis"
vim.cmd(
string.format(
"autocmd WinClosed <buffer=%s> ++nested ++once :lua vim.api.nvim_buf_delete(%s, { force = true })",
bufnr,
bufnr
)
)
vim.api.nvim_create_autocmd("WinClosed", {
event = "WinClosed",
buffer = bufnr,
nested = true,
once = true,
function()
vim.api.nvim_buf_delete(bufnr, { force = true })
end,
})
end
actions.select_vertical:replace(function(prompt_bufnr)