refactor: Require 3 characters for autocomplete, except for commands

This commit is contained in:
Paul Gauthier (aider) 2025-03-12 12:49:57 -07:00
parent e90eb39a9b
commit 881868bf17

View file

@ -194,6 +194,11 @@ class AutoCompleter(Completer):
candidates = [word if type(word) is tuple else (word, word) for word in candidates]
last_word = words[-1]
# Only provide completions if the user has typed at least 3 characters
if len(last_word) < 3:
return
completions = []
for word_match, word_insert in candidates:
if word_match.lower().startswith(last_word.lower()):