From 935234981b01da1bbfc03de963eb5132e58fc805 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 4 Jul 2025 00:38:17 +0800 Subject: [PATCH] fix: missing new_str (#2407) --- lua/avante/llm_tools/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/avante/llm_tools/init.lua b/lua/avante/llm_tools/init.lua index 4f47e81..3c71d81 100644 --- a/lua/avante/llm_tools/init.lua +++ b/lua/avante/llm_tools/init.lua @@ -50,6 +50,10 @@ function M.str_replace_based_edit_tool(opts, on_log, on_complete, session_ctx) return view(opts_, on_log, on_complete, session_ctx) end if opts.command == "str_replace" then + if opts.new_str == nil and opts.file_text ~= nil then + opts.new_str = opts.file_text + opts.file_text = nil + end return require("avante.llm_tools.str_replace").func(opts, on_log, on_complete, session_ctx) end if opts.command == "create" then