Skip to content

Commit 080b937

Browse files
committed
Remove chat headers
1 parent 600e6cd commit 080b937

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

lua/eca/sidebar.lua

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,6 @@ function M:_set_welcome_content()
788788
"",
789789
"---",
790790
"",
791-
"**💬 Messages will appear here:**",
792-
"",
793791
}
794792

795793
Utils.debug("Setting welcome content for new chat")
@@ -1223,12 +1221,12 @@ function M:_update_streaming_message(content)
12231221

12241222
-- Find the assistant message section and update content
12251223
local content_lines = Utils.split_lines(content)
1226-
local start_line = self._last_assistant_line + 2 -- Skip "## 🤖 ECA" and empty line
1224+
local start_line = self._last_assistant_line
12271225

12281226
-- Clear existing assistant content
12291227
local end_line = #lines
12301228
for i = start_line, #lines do
1231-
if lines[i] and (lines[i]:match("^## ") or lines[i]:match("^%-%-%-")) then
1229+
if lines[i] and lines[i]:match("^%-%-%-") then
12321230
end_line = i - 1
12331231
break
12341232
end
@@ -1281,16 +1279,7 @@ function M:_add_message(role, content)
12811279
table.insert(lines, "---")
12821280
table.insert(lines, "")
12831281
end
1284-
1285-
-- Add role header with better markdown formatting
1286-
if role == "user" then
1287-
table.insert(lines, "## 👤 You")
1288-
else
1289-
table.insert(lines, "## 🤖 ECA")
1290-
end
1291-
1292-
table.insert(lines, "")
1293-
1282+
12941283
-- Add content with better markdown formatting
12951284
local content_lines = Utils.split_lines(content)
12961285

@@ -1312,8 +1301,17 @@ function M:_add_message(role, content)
13121301
table.insert(lines, "```")
13131302
else
13141303
-- Regular text content
1315-
for _, line in ipairs(content_lines) do
1316-
table.insert(lines, line)
1304+
for i, line in ipairs(content_lines) do
1305+
if i == 1 then
1306+
if role == "user" then
1307+
table.insert(lines, "> " .. line)
1308+
end
1309+
if role == "assistant" then
1310+
table.insert(lines, "🤖 " .. line)
1311+
end
1312+
else
1313+
table.insert(lines, line)
1314+
end
13171315
end
13181316
end
13191317

@@ -1371,7 +1369,7 @@ function M:_get_last_message_line()
13711369

13721370
local lines = vim.api.nvim_buf_get_lines(chat.bufnr, 0, -1, false)
13731371
for i = #lines, 1, -1 do
1374-
if lines[i] and lines[i]:match("^## 🤖 ECA") then
1372+
if lines[i] and lines[i]:match("^🤖 ") then
13751373
return i
13761374
end
13771375
end
@@ -1475,4 +1473,4 @@ function M:_finalize_tool_call()
14751473
self._is_tool_call_streaming = false
14761474
end
14771475

1478-
return M
1476+
return M

0 commit comments

Comments
 (0)