From 99023686dbf41d1ead90d4fe7c2f8e91856f97a7 Mon Sep 17 00:00:00 2001 From: Acly Date: Fri, 29 Nov 2024 11:11:53 +0100 Subject: [PATCH] Open auto-complete only if there are at least 3 characters _excluding_ trailing space #1417 --- ai_diffusion/ui/autocomplete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = ""