mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Merge pull request #794 from abdnh/tagedit-enter-fix
Don't apply suggestion when no suggestion list is shown in tagedit
This commit is contained in:
commit
f947a65ac5
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ class TagEdit(QLineEdit):
|
||||||
if not self.completer.setCurrentRow(cur_row + 1):
|
if not self.completer.setCurrentRow(cur_row + 1):
|
||||||
self.completer.setCurrentRow(0)
|
self.completer.setCurrentRow(0)
|
||||||
return
|
return
|
||||||
if evt.key() in (Qt.Key_Enter, Qt.Key_Return):
|
if (
|
||||||
|
evt.key() in (Qt.Key_Enter, Qt.Key_Return)
|
||||||
|
and self.completer.popup().isVisible()
|
||||||
|
):
|
||||||
# apply first completion if no suggestion selected
|
# apply first completion if no suggestion selected
|
||||||
selected_row = self.completer.popup().currentIndex().row()
|
selected_row = self.completer.popup().currentIndex().row()
|
||||||
if selected_row == -1:
|
if selected_row == -1:
|
||||||
|
|
Loading…
Reference in a new issue