mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
Space-separate inserted tags
New completions now show up after hitting space again
This commit is contained in:
parent
e237324873
commit
8d6507c062
1 changed files with 5 additions and 4 deletions
|
@ -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) + " "
|
Loading…
Reference in a new issue