mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 19:55: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):
|
def do_live_diff(self, full_path, new_lines, final):
|
||||||
if Path(full_path).exists():
|
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(
|
show_diff = diffs.diff_partial_update(
|
||||||
orig_lines,
|
orig_lines,
|
||||||
new_lines,
|
new_lines,
|
||||||
final=final,
|
final=final,
|
||||||
).splitlines()
|
).splitlines()
|
||||||
output = show_diff
|
return show_diff
|
||||||
else:
|
|
||||||
output = ["```"] + new_lines + ["```"]
|
|
||||||
|
|
||||||
|
output = ["```"] + new_lines + ["```"]
|
||||||
return output
|
return output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue