This commit is contained in:
Paul Gauthier 2024-09-02 11:08:38 -07:00
parent bd012d63e9
commit 7db3ca50e8

View file

@ -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