From 44e3ef690fa0a64638e14a51e9e1cd2706715e31 Mon Sep 17 00:00:00 2001 From: abdo Date: Wed, 14 Oct 2020 05:00:24 +0300 Subject: [PATCH] Don't apply suggestion when no suggestion list is shown --- qt/aqt/tagedit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt/aqt/tagedit.py b/qt/aqt/tagedit.py index 1ad91c5c8..a0ba44b26 100644 --- a/qt/aqt/tagedit.py +++ b/qt/aqt/tagedit.py @@ -56,7 +56,10 @@ class TagEdit(QLineEdit): if not self.completer.setCurrentRow(cur_row + 1): self.completer.setCurrentRow(0) 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 selected_row = self.completer.popup().currentIndex().row() if selected_row == -1: