mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
fix: Remove unnecessary paginate parameter from cmd_diff method
This commit is contained in:
parent
bba0735878
commit
08862c73e7
2 changed files with 6 additions and 16 deletions
|
@ -1647,7 +1647,7 @@ class Coder:
|
||||||
self.aider_commit_hashes.add(commit_hash)
|
self.aider_commit_hashes.add(commit_hash)
|
||||||
self.last_aider_commit_message = commit_message
|
self.last_aider_commit_message = commit_message
|
||||||
if self.show_diffs:
|
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}.")
|
self.io.tool_output(f"You can use /undo to revert and discard commit {commit_hash}.")
|
||||||
|
|
||||||
|
|
|
@ -144,11 +144,8 @@ class Commands:
|
||||||
self.io.tool_output("... done.")
|
self.io.tool_output("... done.")
|
||||||
|
|
||||||
if paginate:
|
if paginate:
|
||||||
# Use pypager to show the content
|
with self.io.console.pager():
|
||||||
source = StringSource(content)
|
self.io.console.print(content)
|
||||||
pager = Pager()
|
|
||||||
pager.add_source(source)
|
|
||||||
pager.run()
|
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
@ -470,7 +467,7 @@ class Commands:
|
||||||
if self.coder.main_model.send_undo_reply:
|
if self.coder.main_model.send_undo_reply:
|
||||||
return prompts.undo_command_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"
|
"Display the diff of the last aider commit"
|
||||||
if not self.coder.repo:
|
if not self.coder.repo:
|
||||||
self.io.tool_error("No git repository found.")
|
self.io.tool_error("No git repository found.")
|
||||||
|
@ -489,15 +486,8 @@ class Commands:
|
||||||
"HEAD",
|
"HEAD",
|
||||||
)
|
)
|
||||||
|
|
||||||
if paginate:
|
# don't use io.tool_output() because we don't want to log or further colorize
|
||||||
# Use pypager to show the content
|
print(diff)
|
||||||
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)
|
|
||||||
|
|
||||||
def quote_fname(self, fname):
|
def quote_fname(self, fname):
|
||||||
if " " in fname and '"' not in fname:
|
if " " in fname and '"' not in fname:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue