Show key hints for all modes, not just normal.
This commit is contained in:
parent
8406746889
commit
e7ff717d52
@ -294,12 +294,15 @@ class MainWindow(QWidget):
|
||||
# commands
|
||||
keyparsers[usertypes.KeyMode.normal].keystring_updated.connect(
|
||||
status.keystring.setText)
|
||||
keyparsers[usertypes.KeyMode.normal].keystring_updated.connect(
|
||||
self._keyhint.update_keyhint)
|
||||
cmd.got_cmd.connect(self._commandrunner.run_safely)
|
||||
cmd.returnPressed.connect(tabs.on_cmd_return_pressed)
|
||||
tabs.got_cmd.connect(self._commandrunner.run_safely)
|
||||
|
||||
# key hint popup
|
||||
for mode, parser in keyparsers.items():
|
||||
parser.keystring_updated.connect(functools.partial(
|
||||
self._keyhint.update_keyhint, mode.name))
|
||||
|
||||
# config
|
||||
for obj in keyparsers.values():
|
||||
key_config.changed.connect(obj.on_keyconfig_changed)
|
||||
|
@ -80,7 +80,7 @@ class KeyHintView(QLabel):
|
||||
super().showEvent(e)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def update_keyhint(self, prefix):
|
||||
def update_keyhint(self, modename, prefix):
|
||||
"""Show hints for the given prefix (or hide if prefix is empty).
|
||||
|
||||
Args:
|
||||
@ -95,7 +95,7 @@ class KeyHintView(QLabel):
|
||||
text = ''
|
||||
keyconf = objreg.get('key-config')
|
||||
# this is only fired in normal mode
|
||||
for key, cmd in keyconf.get_bindings_for('normal').items():
|
||||
for key, cmd in keyconf.get_bindings_for(modename).items():
|
||||
if key.startswith(prefix):
|
||||
suffix = "<font color={}>{}</font>".format(self._suffix_color,
|
||||
key[len(prefix):])
|
||||
|
Loading…
Reference in New Issue
Block a user