Skip to content

Commit b08329f

Browse files
committed
inline function
1 parent b1c2c5b commit b08329f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lua/eca/sidebar.lua

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ local WINDOW_MARGIN = 3 -- Additional margin for window borders and spacing
3333
local UI_ELEMENTS_HEIGHT = 2 -- Reserve space for statusline and tabline
3434
local SAFETY_MARGIN = 2 -- Extra margin to prevent "Not enough room" errors
3535

36-
---@param sidebar eca.Sidebar
37-
---@return fun(message: table)
38-
local function make_handler(sidebar)
39-
return function(message)
40-
sidebar:handle_chat_content(message)
41-
end
42-
end
43-
4436
---@param id integer Tab ID
4537
---@return eca.Sidebar
4638
function M.new(id)
@@ -64,7 +56,9 @@ function M.new(id)
6456
instance._response_start_time = 0
6557
instance._max_response_length = 50000 -- 50KB max response
6658

67-
require("eca.observer").subscribe(id, make_handler(instance))
59+
require("eca.observer").subscribe(id, function(message)
60+
instance:handle_chat_content(message)
61+
end)
6862
return instance
6963
end
7064

@@ -1170,7 +1164,7 @@ function M:_send_message(message)
11701164
-- Include active contexts in the message
11711165
local contexts = self:get_contexts()
11721166
eca.server:send_request("chat/prompt", {
1173-
chatId = nil,
1167+
chatId = self.id,
11741168
requestId = tostring(os.time()),
11751169
message = message,
11761170
contexts = contexts or {},

0 commit comments

Comments
 (0)