From 64b8fc80e85330874e3d4826c966c88c07a2d04a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 21 Mar 2025 20:40:29 -0700 Subject: [PATCH] refactor: Extract prompt prefix logic in InputOutput class --- aider/io.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/aider/io.py b/aider/io.py index ecf04f790..9ebff252b 100644 --- a/aider/io.py +++ b/aider/io.py @@ -504,11 +504,16 @@ class InputOutput: get_rel_fname(fname, root) for fname in (abs_read_only_fnames or []) ] show = self.format_files_for_input(rel_fnames, rel_read_only_fnames) + + prompt_prefix = "" if edit_format: - show += edit_format + prompt_prefix += edit_format if self.multiline_mode: - show += (" " if edit_format else "") + "multi" - show += "> " + prompt_prefix += (" " if edit_format else "") + "multi" + prompt_prefix += "> " + + show += prompt_prefix + self.prompt_prefix = prompt_prefix inp = "" multiline_input = False @@ -578,7 +583,7 @@ class InputOutput: while True: if multiline_input: - show = "> " + show = self.prompt_prefix try: if self.prompt_session: @@ -594,7 +599,7 @@ class InputOutput: self.clipboard_watcher.start() def get_continuation(width, line_number, is_soft_wrap): - return "> " + return self.prompt_prefix line = self.prompt_session.prompt( show,