From 81e5f1937f47a7fc855e03a41f2af445f2777de9 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 2 Jan 2025 21:34:39 +0800 Subject: [PATCH] fix: Claude sometimes gets lazy and doesnt return the filepath (#1025) --- lua/avante/sidebar.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 4e6a06e..2ec7d33 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -193,6 +193,15 @@ local function transform_result_content(selected_files, result_content, prev_fil end if line_content == "" then is_searching = true + local prev_line = result_lines[i - 1] + if + prev_line + and prev_filepath + and not prev_line:match("Filepath:.+") + and not prev_line:match(".+") + then + table.insert(transformed_lines, string.format("Filepath: %s", prev_filepath)) + end local next_line = result_lines[i + 1] if next_line and next_line:match("^%s*```%w+$") then i = i + 1 end search_start = i + 1