mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 20:54:59 +00:00
feat: prevent adding image files with /read command
This commit is contained in:
parent
af7aaad903
commit
ec40ff5987
1 changed files with 6 additions and 0 deletions
|
@ -1199,6 +1199,12 @@ class Commands:
|
|||
self.io.tool_error(f"Not a file or directory: {abs_path}")
|
||||
|
||||
def _add_read_only_file(self, abs_path, original_name):
|
||||
if is_image_file(original_name):
|
||||
self.io.tool_error(
|
||||
f"Cannot add image file {original_name} as read-only. Use /add for images instead."
|
||||
)
|
||||
return
|
||||
|
||||
if abs_path in self.coder.abs_read_only_fnames:
|
||||
self.io.tool_error(f"{original_name} is already in the chat as a read-only file")
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue