fix: remove trailing spaces each line when editing files (#2612)

This commit is contained in:
brook hong
2025-08-16 14:16:38 +08:00
committed by GitHub
parent be0937a459
commit c1ccb7867a
4 changed files with 21 additions and 1 deletions

View File

@@ -70,6 +70,8 @@ function M.func(input, opts)
Utils.debug("Trimming escapes from content")
input.the_content = Utils.trim_escapes(input.the_content)
end
-- Remove trailing spaces from each line
input.the_content = Utils.remove_trailing_spaces(input.the_content)
local old_lines = Utils.read_file_from_buf_or_disk(abs_path)
local old_content = table.concat(old_lines or {}, "\n")
local str_replace = require("avante.llm_tools.str_replace")