From 8d6507c06234e684e197bb1ca77f43d1501d6aba Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Wed, 30 Aug 2017 14:52:58 +0200 Subject: [PATCH] Space-separate inserted tags New completions now show up after hitting space again --- aqt/tagedit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aqt/tagedit.py b/aqt/tagedit.py index e57c5410c..547e9055e 100644 --- a/aqt/tagedit.py +++ b/aqt/tagedit.py @@ -96,9 +96,10 @@ class TagCompleter(QCompleter): self.tags = self.edit.col.tags.split(stripped_tags) self.tags.append("") p = self.edit.cursorPosition() - self.cursor = stripped_tags.count(" ", 0, p) - if tags.endswith(" "): - self.cursor += 1 + if tags.endswith(" "): + self.cursor = len(self.tags) - 1 + else: + self.cursor = stripped_tags.count(" ", 0, p) return [self.tags[self.cursor]] def pathFromIndex(self, idx): @@ -110,4 +111,4 @@ class TagCompleter(QCompleter): self.tags.remove("") except ValueError: pass - return " ".join(self.tags) + return " ".join(self.tags) + " " \ No newline at end of file