From 87da3a71324f285afbcc95d235190ca57125ec54 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 27 Sep 2024 16:53:15 -0700 Subject: [PATCH] fix: adjust start_position for quoted filename completions in completions_raw_read_only method --- aider/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index d8b663d47..083cdb3ba 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -608,12 +608,15 @@ class Commands: expanduser=True, ) + # Adjust the start_position to replace all of 'after_command' + adjusted_start_position = -len(after_command) + # Iterate over the completions and modify them for completion in path_completer.get_completions(new_document, complete_event): quoted_text = self.quote_fname(completion.text) yield Completion( text=quoted_text, - start_position=completion.start_position, + start_position=adjusted_start_position, display=completion.display, style=completion.style, selected_style=completion.selected_style,