Skip to content

Commit

Permalink
fix: do not use gmatch (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone authored Aug 17, 2024
1 parent f66b5c6 commit d0d4f8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/avante/ai_bot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ local function call_claude_api_stream(question, code_lang, code_content, selecte
if not data then
return
end
for line in data:gmatch("[^\r\n]+") do
for _, line in ipairs(vim.split(data, "\n")) do
if line:sub(1, 6) ~= "data: " then
return
end
Expand Down Expand Up @@ -264,7 +264,7 @@ local function call_openai_api_stream(question, code_lang, code_content, selecte
if not data then
return
end
for line in data:gmatch("[^\r\n]+") do
for _, line in ipairs(vim.split(data, "\n")) do
if line:sub(1, 6) ~= "data: " then
return
end
Expand Down

0 comments on commit d0d4f8a

Please sign in to comment.