mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't error out if ret hit in tag list before selection visible
This commit is contained in:
parent
37490f1046
commit
edc680b2ea
1 changed files with 3 additions and 0 deletions
|
@ -59,6 +59,7 @@ class TagCompleter(QCompleter):
|
|||
QCompleter.__init__(self, model, parent)
|
||||
self.tags = []
|
||||
self.edit = edit
|
||||
self.cursor = None
|
||||
|
||||
def splitPath(self, str):
|
||||
str = unicode(str).strip()
|
||||
|
@ -70,6 +71,8 @@ class TagCompleter(QCompleter):
|
|||
return QStringList(self.tags[self.cursor])
|
||||
|
||||
def pathFromIndex(self, idx):
|
||||
if not self.cursor:
|
||||
return self.edit.text()
|
||||
ret = QCompleter.pathFromIndex(self, idx)
|
||||
self.tags[self.cursor] = unicode(ret)
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue