From 3c1a6acc0dd5a247e66cd23856a156ab083887b4 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 3 Jul 2024 20:12:04 -0300 Subject: [PATCH] handle files with spaces --- aider/commands.py | 2 ++ aider/io.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index ca6875986..ac1f07bf4 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -381,6 +381,7 @@ class Commands: def completions_add(self): files = set(self.coder.get_all_relative_files()) files = files - set(self.coder.get_inchat_relative_files()) + files = [self.quote_fname(fn) for fn in files] return files def glob_filtered_to_repo(self, pattern): @@ -484,6 +485,7 @@ class Commands: def completions_drop(self): files = self.coder.get_inchat_relative_files() + files = [self.quote_fname(fn) for fn in files] return files def cmd_drop(self, args=""): diff --git a/aider/io.py b/aider/io.py index 160c855a2..aaa34a07b 100644 --- a/aider/io.py +++ b/aider/io.py @@ -72,7 +72,7 @@ class AutoCompleter(Completer): for cmd in candidates: if cmd.startswith(partial): yield Completion(cmd, start_position=-len(partial)) - elif len(words) > 1: + elif len(words) > 1 and not text[-1].isspace(): cmd = words[0] partial = words[-1]