From 48b8f54c1269a8d4ecb2aad336ce82d1ebfb7f48 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 4 Jan 2025 11:04:32 -0800 Subject: [PATCH] refactor: Move message and style initialization before try block in InputOutput --- aider/io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/io.py b/aider/io.py index d955cfba1..f6ae71d53 100644 --- a/aider/io.py +++ b/aider/io.py @@ -804,9 +804,9 @@ class InputOutput: hist = message.strip() if strip else message self.append_chat_history(hist, linebreak=True, blockquote=True) + message = Text(message) + style = dict(style=color) if self.pretty and color else dict() try: - message = Text(message) - style = dict(style=color) if self.pretty and color else dict() self.console.print(message, **style) except UnicodeEncodeError: # Fallback to ASCII-safe output