fix: do not use gmatch (#43)
This commit is contained in:
@@ -149,7 +149,7 @@ local function call_claude_api_stream(question, code_lang, code_content, selecte
|
|||||||
if not data then
|
if not data then
|
||||||
return
|
return
|
||||||
end
|
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
|
if line:sub(1, 6) ~= "data: " then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -264,7 +264,7 @@ local function call_openai_api_stream(question, code_lang, code_content, selecte
|
|||||||
if not data then
|
if not data then
|
||||||
return
|
return
|
||||||
end
|
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
|
if line:sub(1, 6) ~= "data: " then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user