diff --git a/aider/coders/wholefile_coder.py b/aider/coders/wholefile_coder.py index c59e2e4f1..840e88324 100644 --- a/aider/coders/wholefile_coder.py +++ b/aider/coders/wholefile_coder.py @@ -56,7 +56,7 @@ class WholeFileCoder(Coder): full_path = (Path(self.root) / fname).absolute() if mode == "diff": - output += self.do_live_diff(full_path, new_lines) + output += self.do_live_diff(full_path, new_lines, True) elif self.allowed_to_edit(fname): edited.add(fname) new_lines = "".join(new_lines) @@ -101,7 +101,7 @@ class WholeFileCoder(Coder): if fname is not None: # ending an existing block full_path = (Path(self.root) / fname).absolute() - output += self.do_live_diff(full_path, new_lines) + output += self.do_live_diff(full_path, new_lines, False) return "\n".join(output) if fname: @@ -113,14 +113,14 @@ class WholeFileCoder(Coder): return edited - def do_live_diff(self, full_path, new_lines): + def do_live_diff(self, full_path, new_lines, final): if full_path.exists(): orig_lines = self.io.read_text(full_path).splitlines(keepends=True) show_diff = diffs.diff_partial_update( orig_lines, new_lines, - final=True, + final=final, ).splitlines() output = show_diff else: