fix (sidebar) only display apply ext marks for codeblocks that can be applied (#883)

This commit is contained in:
Christopher Brewin 2024-11-23 14:48:21 +10:00 committed by GitHub
parent 9d2599df4d
commit da41105fc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -530,7 +530,7 @@ local function parse_codeblocks(buf)
if in_codeblock and not lang_ then
table.insert(codeblocks, { start_line = start_line, end_line = i - 1, lang = lang })
in_codeblock = false
elseif lang_ then
elseif lang_ and lines[i - 1]:match("^%s*(%d*)[%.%)%s]*[Aa]?n?d?%s*[Rr]eplace%s+[Ll]ines:?%s*(%d+)%-(%d+)") then
lang = lang_
start_line = i - 1
in_codeblock = true