Skip to content

Commit

Permalink
Normalized file paths in the get_file_mentions method to handle bot…
Browse files Browse the repository at this point in the history
…h Unix and Windows formats.
  • Loading branch information
paul-gauthier committed Jul 18, 2024
1 parent 07550d6 commit 55301e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,9 @@ def get_file_mentions(self, content):
fname_to_rel_fnames = {}
for rel_fname in addable_rel_fnames:
normalized_rel_fname = rel_fname.replace('\\', '/')
if normalized_rel_fname in words or rel_fname in words:
mentioned_rel_fnames.add(str(rel_fname))
normalized_words = set(word.replace('\\', '/') for word in words)
if normalized_rel_fname in normalized_words:
mentioned_rel_fnames.add(rel_fname)

fname = os.path.basename(rel_fname)

Expand Down

0 comments on commit 55301e4

Please sign in to comment.