fix(refresh): check if sidebar is available or not (#333)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-08-28 14:52:57 -04:00
committed by GitHub
parent c635f73748
commit 2e48174d09

View File

@@ -190,6 +190,10 @@ M.refresh = function()
if not sidebar then if not sidebar then
return return
end end
if not sidebar:is_open() then
return
end
local curbuf = vim.api.nvim_get_current_buf() local curbuf = vim.api.nvim_get_current_buf()
local focused = sidebar.result.bufnr == curbuf or sidebar.input.bufnr == curbuf local focused = sidebar.result.bufnr == curbuf or sidebar.input.bufnr == curbuf