mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
fixes #1298
This commit is contained in:
parent
bd012d63e9
commit
7db3ca50e8
1 changed files with 10 additions and 9 deletions
|
@ -127,15 +127,16 @@ class WholeFileCoder(Coder):
|
|||
|
||||
def do_live_diff(self, full_path, new_lines, final):
|
||||
if Path(full_path).exists():
|
||||
orig_lines = self.io.read_text(full_path).splitlines(keepends=True)
|
||||
orig_lines = self.io.read_text(full_path)
|
||||
if orig_lines is not None:
|
||||
orig_lines = orig_lines.splitlines(keepends=True)
|
||||
|
||||
show_diff = diffs.diff_partial_update(
|
||||
orig_lines,
|
||||
new_lines,
|
||||
final=final,
|
||||
).splitlines()
|
||||
output = show_diff
|
||||
else:
|
||||
output = ["```"] + new_lines + ["```"]
|
||||
show_diff = diffs.diff_partial_update(
|
||||
orig_lines,
|
||||
new_lines,
|
||||
final=final,
|
||||
).splitlines()
|
||||
return show_diff
|
||||
|
||||
output = ["```"] + new_lines + ["```"]
|
||||
return output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue