aider: Added function to print unified diff and find last non-deleted line.

# Context:
USER: do the todo
This commit is contained in:
Paul Gauthier 2023-06-05 16:47:52 -07:00
parent 2f684bf99e
commit 67121a9834

View file

@ -17,6 +17,12 @@ def main():
with open(file_updated, "r") as f:
lines_updated = f.readlines()
unified_diff = difflib.unified_diff(lines_orig, lines_updated, fromfile=file_orig, tofile=file_updated)
for line in unified_diff:
print(line, end="")
def find_last_non_deleted(lines_orig, lines_updated):
diff = list(difflib.ndiff(lines_orig, lines_updated))
num_orig = 0