mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
aider: Added function to print unified diff and find last non-deleted line.
# Context: USER: do the todo
This commit is contained in:
parent
2f684bf99e
commit
67121a9834
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue