mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -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 = self.edit.col.tags.split(stripped_tags)
|
||||||
self.tags.append("")
|
self.tags.append("")
|
||||||
p = self.edit.cursorPosition()
|
p = self.edit.cursorPosition()
|
||||||
self.cursor = stripped_tags.count(" ", 0, p)
|
if tags.endswith(" "):
|
||||||
if tags.endswith(" "):
|
self.cursor = len(self.tags) - 1
|
||||||
self.cursor += 1
|
else:
|
||||||
|
self.cursor = stripped_tags.count(" ", 0, p)
|
||||||
return [self.tags[self.cursor]]
|
return [self.tags[self.cursor]]
|
||||||
|
|
||||||
def pathFromIndex(self, idx):
|
def pathFromIndex(self, idx):
|
||||||
|
@ -110,4 +111,4 @@ class TagCompleter(QCompleter):
|
||||||
self.tags.remove("")
|
self.tags.remove("")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
return " ".join(self.tags)
|
return " ".join(self.tags) + " "
|
Loading…
Reference in a new issue