This commit is contained in:
akioweh 2026-06-02 16:48:49 +03:00 committed by GitHub
commit 2f76814951
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,6 +78,10 @@ vim.api.nvim_create_autocmd("FileType", {
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.schedule(function()
-- without this, vim.keymap.set below may throw on transient buffers
if not vim.api.nvim_buf_is_valid(event.buf) then
return
end
vim.keymap.set("n", "q", function()
vim.cmd("close")
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })