Skip to content

Commit db32bc3

Browse files
committed
fix bufnr nil when config/tool updated message arrives and chat is not open
1 parent d36ede9 commit db32bc3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/eca/sidebar.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ function M:reset()
179179

180180
-- Reset all state
181181
self.containers = {}
182+
self.extmarks = {}
182183
self._initialized = false
183184
self._is_streaming = false
184185
self._current_response_buffer = ""
@@ -1080,7 +1081,7 @@ end
10801081

10811082
function M:_update_config_display()
10821083
local config = self.containers.config
1083-
if not config or not vim.api.nvim_buf_is_valid(config.bufnr) then
1084+
if not config or not config.bufnr or not vim.api.nvim_buf_is_valid(config.bufnr) then
10841085
return
10851086
end
10861087

@@ -1165,7 +1166,7 @@ end
11651166

11661167
function M:_update_usage_info()
11671168
local usage = self.containers.usage
1168-
if not usage or not vim.api.nvim_buf_is_valid(usage.bufnr) then
1169+
if not usage or not usage.bufnr or not vim.api.nvim_buf_is_valid(usage.bufnr) then
11691170
return
11701171
end
11711172

0 commit comments

Comments
 (0)