From e2373248731f3346f61cf18d2ef861a9c8929679 Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Wed, 30 Aug 2017 14:19:15 +0200 Subject: [PATCH] Show new autosuggestions on typing space --- aqt/tagedit.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aqt/tagedit.py b/aqt/tagedit.py index 2236f901e..e57c5410c 100644 --- a/aqt/tagedit.py +++ b/aqt/tagedit.py @@ -91,12 +91,14 @@ class TagCompleter(QCompleter): self.cursor = None def splitPath(self, tags): - tags = tags.strip() - tags = re.sub(" +", " ", tags) - self.tags = self.edit.col.tags.split(tags) + stripped_tags = tags.strip() + stripped_tags = re.sub(" +", " ", stripped_tags) + self.tags = self.edit.col.tags.split(stripped_tags) self.tags.append("") p = self.edit.cursorPosition() - self.cursor = tags.count(" ", 0, p) + self.cursor = stripped_tags.count(" ", 0, p) + if tags.endswith(" "): + self.cursor += 1 return [self.tags[self.cursor]] def pathFromIndex(self, idx):