Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions chatbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ local is_receiving = false
local bot_cmd = os.getenv("SHELLBOT")
local separator = "==="

local nbsp = 'ย '
local roles = {
USER = "โ—ญ๐Ÿง‘ " .. os.getenv('USER'),
ASSISTANT = "โ—ฎ๐Ÿค– vimbot",
USER = nbsp .. "๐Ÿค“ ยซ" .. os.getenv('USER') .. "ยป" .. nbsp,
ASSISTANT = nbsp .. "๐Ÿค– ยซvimbotยป" .. nbsp,
}

local buffer_sync_cursor = {}
Expand Down Expand Up @@ -95,9 +96,9 @@ function ChatBotSubmit()
local function get_transcript()
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
for i, line in ipairs(lines) do
if line:match("^โ—ญ") then -- '^' means start of line
if line:match('^' .. nbsp .. '๐Ÿค“') then -- '^' means start of line
lines[i] = separator .. "USER" .. separator
elseif line:match("^โ—ฎ") then
elseif line:match('^' .. nbsp ..'๐Ÿค–') then
lines[i] = separator .. "ASSISTANT" .. separator
end
end
Expand Down