From c2afdcfdb945644ee85351710e7b30af251a5ac8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 16:10:16 -0700 Subject: [PATCH] fix: Create new Document object for path completion in completions_raw_read_only --- aider/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 8ab881ec8..5ec0d566a 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -589,8 +589,11 @@ class Commands: get_paths=lambda: [self.coder.root], ) + # Create a new Document object with the modified text + new_document = Document(text, cursor_position=len(text)) + # Get completions from the PathCompleter - completions = path_completer.get_completions(document.replace(text=text), complete_event) + completions = path_completer.get_completions(new_document, complete_event) # Yield the completions for completion in completions: