fix: adjust start_position for quoted filename completions in completions_raw_read_only method

This commit is contained in:
Paul Gauthier (aider) 2024-09-27 16:53:15 -07:00
parent eef97e4938
commit 87da3a7132

View file

@ -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,