From 1408a8edc9da74a116650f21a01d0c6b76f87022 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 12:18:14 -0700 Subject: [PATCH] aider: Changed matched_files to match against the relative_fname version of each file in cmd_drop. # Context: USER: in cmd_drop, matched_files should match against self.fnames directly. it should match against the relative_fname version of each file ASSISTANT: ```python aider/coder.py <<<<<<< ORIGINAL matched_files = [file for file in self.fnames if word in file] ======= matched_files = [file for file in self.fnames if word in os.path.relpath(file, self.root)] >>>>>>> UPDATED ``` --- aider/coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coder.py b/aider/coder.py index 626994749..2d76d702c 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -502,7 +502,7 @@ class Coder: "Remove files from the chat" for word in args.split(): - matched_files = [file for file in self.fnames if word in file] + matched_files = [file for file in self.fnames if word in os.path.relpath(file, self.root)] for matched_file in matched_files: relative_fname = os.path.relpath(matched_file, self.root) self.fnames.remove(matched_file)