fix: handle newline issues in patch generation

This commit is contained in:
mrT23
2025-01-04 16:26:38 +02:00
parent bde594c9e8
commit e431979b8b
2 changed files with 28 additions and 0 deletions

View File

@ -588,6 +588,8 @@ def load_large_diff(filename, new_file_content_str: str, original_file_content_s
return ""
try:
original_file_content_str = original_file_content_str.rstrip() + "\n"
new_file_content_str = new_file_content_str.rstrip() + "\n"
diff = difflib.unified_diff(original_file_content_str.splitlines(keepends=True),
new_file_content_str.splitlines(keepends=True))
if get_settings().config.verbosity_level >= 2 and show_warning: