mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
feat: Add placeholder functionality to input prompts
This commit is contained in:
parent
60d82eddee
commit
48e7376002
1 changed files with 10 additions and 0 deletions
10
aider/io.py
10
aider/io.py
|
@ -198,6 +198,7 @@ class InputOutput:
|
|||
editingmode=EditingMode.EMACS,
|
||||
fancy_input=True,
|
||||
):
|
||||
self.placeholder = None
|
||||
self.never_prompts = set()
|
||||
self.editingmode = editingmode
|
||||
no_color = os.environ.get("NO_COLOR")
|
||||
|
@ -427,8 +428,13 @@ class InputOutput:
|
|||
|
||||
try:
|
||||
if self.prompt_session:
|
||||
# Use placeholder if set, then clear it
|
||||
default = self.placeholder
|
||||
self.placeholder = None
|
||||
|
||||
line = self.prompt_session.prompt(
|
||||
show,
|
||||
default=default,
|
||||
completer=completer_instance,
|
||||
reserve_space_for_menu=4,
|
||||
complete_style=CompleteStyle.MULTI_COLUMN,
|
||||
|
@ -739,6 +745,10 @@ class InputOutput:
|
|||
|
||||
self.console.print(show_resp)
|
||||
|
||||
def set_placeholder(self, placeholder):
|
||||
"""Set a one-time placeholder text for the next input prompt."""
|
||||
self.placeholder = placeholder
|
||||
|
||||
def print(self, message=""):
|
||||
print(message)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue