mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Disable pretty when the fence is an html tag not triple-backticks
This commit is contained in:
parent
00cd460ed8
commit
f0711d4b96
1 changed files with 13 additions and 3 deletions
|
@ -225,6 +225,16 @@ class Coder:
|
||||||
]
|
]
|
||||||
fence = fences[0]
|
fence = fences[0]
|
||||||
|
|
||||||
|
def show_pretty(self):
|
||||||
|
if not self.pretty:
|
||||||
|
return False
|
||||||
|
|
||||||
|
# only show pretty output if fences are the normal triple-backtick
|
||||||
|
if self.fence != self.fences[0]:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def get_abs_fnames_content(self):
|
def get_abs_fnames_content(self):
|
||||||
for fname in list(self.abs_fnames):
|
for fname in list(self.abs_fnames):
|
||||||
content = self.io.read_text(fname)
|
content = self.io.read_text(fname)
|
||||||
|
@ -614,7 +624,7 @@ class Coder:
|
||||||
self.total_cost += cost
|
self.total_cost += cost
|
||||||
|
|
||||||
show_resp = self.render_incremental_response(True)
|
show_resp = self.render_incremental_response(True)
|
||||||
if self.pretty:
|
if self.show_pretty():
|
||||||
show_resp = Markdown(
|
show_resp = Markdown(
|
||||||
show_resp, style=self.assistant_output_color, code_theme=self.code_theme
|
show_resp, style=self.assistant_output_color, code_theme=self.code_theme
|
||||||
)
|
)
|
||||||
|
@ -628,7 +638,7 @@ class Coder:
|
||||||
|
|
||||||
def show_send_output_stream(self, completion):
|
def show_send_output_stream(self, completion):
|
||||||
live = None
|
live = None
|
||||||
if self.pretty:
|
if self.show_pretty():
|
||||||
live = Live(vertical_overflow="scroll")
|
live = Live(vertical_overflow="scroll")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -663,7 +673,7 @@ class Coder:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
text = None
|
text = None
|
||||||
|
|
||||||
if self.pretty:
|
if self.show_pretty():
|
||||||
self.live_incremental_response(live, False)
|
self.live_incremental_response(live, False)
|
||||||
elif text:
|
elif text:
|
||||||
sys.stdout.write(text)
|
sys.stdout.write(text)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue