fix(autocmds): fix q close for temp windows not working everywhere

This commit is contained in:
Micah Halter
2023-07-07 07:09:53 -04:00
parent 775c409f0c
commit f714cd8800
+1 -2
View File
@@ -94,9 +94,8 @@ autocmd("BufWinEnter", {
desc = "Make q close help, man, quickfix, dap floats",
group = augroup("q_close_windows", { clear = true }),
callback = function(event)
local filetype = vim.api.nvim_get_option_value("filetype", { buf = event.buf })
local buftype = vim.api.nvim_get_option_value("buftype", { buf = event.buf })
if buftype == "nofile" or filetype == "help" then
if vim.tbl_contains({ "help", "nofile", "quickfix" }, buftype) then
vim.keymap.set("n", "q", "<cmd>close<cr>", {
desc = "Close window",
buffer = event.buf,