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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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