mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
![]() # Context: USER: in get_input, instead of showing the full file paths... remove the common directory prefix that they all share ASSISTANT: To remove the common directory prefix from the file paths, we can use the `os.path.commonprefix()` function and then remove the common prefix from each file path. Here's the change: ```python aider/getinput.py <<<<<<< ORIGINAL def get_input(history_file, fnames): show = ' '.join(fnames) ======= import os def get_input(history_file, fnames): common_prefix = os.path.commonprefix(fnames) short_fnames = [fname.replace(common_prefix, '', 1) for fname in fnames] show = ' '.join(short_fnames) >>>>>>> UPDATED show += "\n> " ``` |
||
---|---|---|
.. | ||
__init__.py | ||
coder.py | ||
dump.py | ||
getinput.py | ||
main.py | ||
prompts.py | ||
test_utils.py | ||
utils.py |