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

@@ -163,7 +163,8 @@ function M.func(input, opts)
elseif is_searching then
table.insert(current_old_lines, line)
elseif is_replacing then
table.insert(current_new_lines, line)
-- Remove trailing spaces from each line before adding to new_lines
table.insert(current_new_lines, (line:gsub("%s+$", "")))
end
end