From da41105fc831a6db2f7af9f959fcd513b34ba2d3 Mon Sep 17 00:00:00 2001 From: Christopher Brewin Date: Sat, 23 Nov 2024 14:48:21 +1000 Subject: [PATCH] fix (sidebar) only display apply ext marks for codeblocks that can be applied (#883) --- lua/avante/sidebar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 50e607f..5b7f728 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -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