fix: trim escapes for write_to_file tool (#2455)

This commit is contained in:
yetone
2025-07-16 12:04:22 +08:00
committed by GitHub
parent 31be8718a6
commit 127a12a878
3 changed files with 8 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ function M.func(input, opts)
if Path:new(abs_path):exists() then return false, "File already exists: " .. abs_path end
local lines = vim.split(input.file_text, "\n")
if #lines == 1 and input.file_text:match("\\n") then
local text = Utils.trim_slashes(input.file_text)
local text = Utils.trim_escapes(input.file_text)
lines = vim.split(text, "\n")
end
local bufnr, err = Helpers.get_bufnr(abs_path)