mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: Extract prompt prefix logic in InputOutput class
This commit is contained in:
parent
033c149737
commit
64b8fc80e8
1 changed files with 10 additions and 5 deletions
15
aider/io.py
15
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue