From ff23292f8316bc757af81d9cb21c892de71b1079 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 12:51:02 -0700 Subject: [PATCH] Changed the way to display git diff in coder.py. --- aider/coder.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aider/coder.py b/aider/coder.py index 52fc39ee7..ad88f2b1e 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -529,12 +529,14 @@ class Coder: self.console.print("[red]No previous aider commit found.") return - diff = self.repo.git.diff(f"{self.last_aider_commit_hash}~1", self.last_aider_commit_hash) + commits = f"{self.last_aider_commit_hash}~1" if self.pretty: - syntax_diff = Syntax(diff, "diff", theme="monokai", line_numbers=False) - self.console.print(syntax_diff) + diff = self.repo.git.diff(commits, "--color", self.last_aider_commit_hash) else: - self.console.print(Text(diff)) + diff = self.repo.git.diff(commits, self.last_aider_commit_hash) + + self.console.print(Text(diff)) + def cmd_add(self, args): "Add matching files to the chat"