Skip to content

Commit a8aa926

Browse files
committed
pr review changes
1 parent 837c774 commit a8aa926

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/eca/sidebar.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,8 @@ function M:_update_input_display(opts)
797797

798798
-- Set cursor to end of input line
799799
if vim.api.nvim_win_is_valid(input.winid) then
800-
local row = 1 + (not clear and existing_lines and #existing_lines > 0 and #existing_lines or 1)
801-
local col = #prefix + (not clear and existing_lines and #existing_lines > 0 and #existing_lines[#existing_lines] or 0)
800+
local row = 1 + ((not clear and existing_lines and #existing_lines > 0) and #existing_lines or 1)
801+
local col = #prefix + ((not clear and existing_lines and #existing_lines > 0) and #existing_lines[#existing_lines] or 0)
802802

803803
vim.api.nvim_win_set_cursor(input.winid, { row, col })
804804
end
@@ -1048,17 +1048,17 @@ end
10481048

10491049
---@param message string
10501050
function M:_send_message(message)
1051-
if not message or not type(message) == "string" then
1051+
if not message or type(message) ~= "string" then
10521052
Logger.error("Cannot send empty message")
10531053
return
10541054
end
10551055

10561056
-- Add user message to chat
10571057
self:_add_message("user", message)
10581058

1059-
local replaced = message:gsub("([@#])([%w%._%-%/]+)", function(prefix, path)
1059+
local replaced = message:gsub("([@#])([%w%._%-%/\\]+)", function(prefix, path)
10601060
-- expand ~
1061-
if path:sub(1,1) == "~" then
1061+
if vim.startswith(path, "~") then
10621062
path = vim.fn.expand(path)
10631063
end
10641064
return prefix .. vim.fn.fnamemodify(path, ":p")

0 commit comments

Comments
 (0)