mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
show the files at the chat prompt
This commit is contained in:
parent
b9fd79acb6
commit
2b42d76e3f
1 changed files with 6 additions and 5 deletions
|
@ -31,12 +31,12 @@ class FileContentCompleter(Completer):
|
||||||
yield Completion(word, start_position=-len(last_word))
|
yield Completion(word, start_position=-len(last_word))
|
||||||
|
|
||||||
|
|
||||||
def canned_input():
|
def canned_input(show_prompt):
|
||||||
console = Console()
|
console = Console()
|
||||||
|
|
||||||
input_line = input()
|
input_line = input()
|
||||||
|
|
||||||
console.print("> ", end="", style="green")
|
console.print(show_prompt, end="", style="green")
|
||||||
for char in input_line:
|
for char in input_line:
|
||||||
console.print(char, end="", style="green")
|
console.print(char, end="", style="green")
|
||||||
time.sleep(random.uniform(0.01, 0.15))
|
time.sleep(random.uniform(0.01, 0.15))
|
||||||
|
@ -46,8 +46,11 @@ def canned_input():
|
||||||
|
|
||||||
|
|
||||||
def get_input(history_file, fnames):
|
def get_input(history_file, fnames):
|
||||||
|
show = ' '.join(fnames)
|
||||||
|
show += "\n> "
|
||||||
|
|
||||||
if not sys.stdin.isatty():
|
if not sys.stdin.isatty():
|
||||||
return canned_input()
|
return canned_input(show_prompt)
|
||||||
|
|
||||||
inp = ""
|
inp = ""
|
||||||
multiline_input = False
|
multiline_input = False
|
||||||
|
@ -58,8 +61,6 @@ def get_input(history_file, fnames):
|
||||||
completer_instance = FileContentCompleter(fnames)
|
completer_instance = FileContentCompleter(fnames)
|
||||||
if multiline_input:
|
if multiline_input:
|
||||||
show = ". "
|
show = ". "
|
||||||
else:
|
|
||||||
show = "> "
|
|
||||||
|
|
||||||
line = prompt(
|
line = prompt(
|
||||||
show,
|
show,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue