diff --git a/ai_diffusion/ui/autocomplete.py b/ai_diffusion/ui/autocomplete.py index 72bf04fe6..4c96b19b8 100644 --- a/ai_diffusion/ui/autocomplete.py +++ b/ai_diffusion/ui/autocomplete.py @@ -217,7 +217,7 @@ def check_completion(self): # fall through to tag search self._completion_prefix = prefix = self._current_text(separators="()>,\n").lstrip() name = prefix.replace("\\(", "(").replace("\\)", ")") - if not name.startswith("<") and len(name) > 2: + if not name.startswith("<") and len(name.rstrip()) > 2: self._completer.setModel(_tag_model) self._popup.setItemDelegate(TagCompleterDelegate()) self._completion_suffix = ""