From a28cf7ad0ddbe7ad3d16ae4419418c4e3d7ccb0e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:07:36 +0300 Subject: [PATCH] fix(autocmds): change mapping for `lazyvim_close_with_q` Currently `checkhealth` buffers stay visible on `bufferline` when you close them with `q`. Use `:bd` instead to delete the buffer from bufferlist. `vim.schedule` is needed because `LspInfo` adds its own mapping to close the window, so we need to overwrite it. --- lua/lazyvim/config/autocmds.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 7839950b..bc52c876 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -72,11 +72,13 @@ vim.api.nvim_create_autocmd("FileType", { }, callback = function(event) vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { - buffer = event.buf, - silent = true, - desc = "Quit buffer", - }) + vim.schedule(function() + vim.keymap.set("n", "q", ":bd", { + buffer = event.buf, + silent = true, + desc = "Quit buffer", + }) + end) end, })