fix: snippets missing empty lines (#42)

This commit is contained in:
yetone 2024-08-17 22:52:57 +08:00 committed by GitHub
parent 83402e4a2d
commit f66b5c6784
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -320,7 +320,7 @@ local function extract_code_snippets(content)
local lang, start_line, end_line
local explanation = ""
for line in content:gmatch("[^\r\n]+") do
for _, line in ipairs(vim.split(content, "\n")) do
local start_line_str, end_line_str = line:match("^Replace lines: (%d+)-(%d+)")
if start_line_str ~= nil and end_line_str ~= nil then
start_line = tonumber(start_line_str)