fix: Remove unnecessary paginate parameter from cmd_diff method

This commit is contained in:
Paul Gauthier 2024-08-09 18:34:54 -04:00 committed by Paul Gauthier (aider)
parent bba0735878
commit 08862c73e7
2 changed files with 6 additions and 16 deletions

View file

@ -1647,7 +1647,7 @@ class Coder:
self.aider_commit_hashes.add(commit_hash)
self.last_aider_commit_message = commit_message
if self.show_diffs:
self.commands.cmd_diff(paginate=False)
self.commands.cmd_diff()
self.io.tool_output(f"You can use /undo to revert and discard commit {commit_hash}.")

View file

@ -144,11 +144,8 @@ class Commands:
self.io.tool_output("... done.")
if paginate:
# Use pypager to show the content
source = StringSource(content)
pager = Pager()
pager.add_source(source)
pager.run()
with self.io.console.pager():
self.io.console.print(content)
return content
@ -470,7 +467,7 @@ class Commands:
if self.coder.main_model.send_undo_reply:
return prompts.undo_command_reply
def cmd_diff(self, args="", paginate=True):
def cmd_diff(self, args=""):
"Display the diff of the last aider commit"
if not self.coder.repo:
self.io.tool_error("No git repository found.")
@ -489,15 +486,8 @@ class Commands:
"HEAD",
)
if paginate:
# Use pypager to show the content
source = StringSource(diff)
pager = Pager()
pager.add_source(source)
pager.run()
else:
# don't use io.tool_output() because we don't want to log or further colorize
print(diff)
# don't use io.tool_output() because we don't want to log or further colorize
print(diff)
def quote_fname(self, fname):
if " " in fname and '"' not in fname: