From 62590d609c806563b9ff9a8e8818d3ce60e4a049 Mon Sep 17 00:00:00 2001 From: bekaboo <18127878294@qq.com> Date: Wed, 5 Jul 2023 23:32:26 -0500 Subject: [PATCH] fix(menu): error if execute `:bw` in dropbar menu --- lua/dropbar/menu.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/dropbar/menu.lua b/lua/dropbar/menu.lua index b9748512..a8cd14b3 100644 --- a/lua/dropbar/menu.lua +++ b/lua/dropbar/menu.lua @@ -208,7 +208,9 @@ function dropbar_menu_t:del() end self:close() if self.buf then - vim.api.nvim_buf_delete(self.buf, {}) + if vim.api.nvim_buf_is_valid(self.buf) then + vim.api.nvim_buf_delete(self.buf, {}) + end self.buf = nil end if self.win then