From f1f1eec3faf8a331f2c8a099894006c32c3dd40d Mon Sep 17 00:00:00 2001 From: Jimmy Date: Wed, 8 Dec 2021 09:00:18 +1300 Subject: Fix keyhint widget sequence match enum comparison Change it from a truthy check to a != Nomatch check. Also to to improve formatting but the line is probably still too long. --- qutebrowser/misc/keyhintwidget.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'qutebrowser') diff --git a/qutebrowser/misc/keyhintwidget.py b/qutebrowser/misc/keyhintwidget.py index 9de6518f7..e2f15be90 100644 --- a/qutebrowser/misc/keyhintwidget.py +++ b/qutebrowser/misc/keyhintwidget.py @@ -30,6 +30,7 @@ import re from PyQt6.QtWidgets import QLabel, QSizePolicy from PyQt6.QtCore import pyqtSlot, pyqtSignal, Qt +from PyQt6.QtGui import QKeySequence from qutebrowser.config import config, stylesheet from qutebrowser.utils import utils, usertypes @@ -109,10 +110,13 @@ class KeyHintView(QLabel): return cmd and cmd.takes_count() bindings_dict = config.key_instance.get_bindings_for(mode.name) - bindings = [(k, v) for (k, v) in sorted(bindings_dict.items()) - if keyutils.KeySequence.parse(prefix).matches(k) and - not blacklisted(str(k)) and - (takes_count(v) or not countstr)] + bindings = [ + (k, v) + for (k, v) in sorted(bindings_dict.items()) + if keyutils.KeySequence.parse(prefix).matches(k) != QKeySequence.SequenceMatch.NoMatch + and not blacklisted(str(k)) + and (takes_count(v) or not countstr) + ] if not bindings: self._show_timer.stop() -- cgit v1.2.3-54-g00ecf