Merge branch 'blyxxyz-cancel-register-key'
This commit is contained in:
commit
8268c9c22f
@ -267,7 +267,7 @@ class CaretKeyParser(keyparser.CommandKeyParser):
|
||||
self.read_config('caret')
|
||||
|
||||
|
||||
class RegisterKeyParser(keyparser.BaseKeyParser):
|
||||
class RegisterKeyParser(keyparser.CommandKeyParser):
|
||||
|
||||
"""KeyParser for modes that record a register key.
|
||||
|
||||
@ -280,6 +280,7 @@ class RegisterKeyParser(keyparser.BaseKeyParser):
|
||||
super().__init__(win_id, parent, supports_count=False,
|
||||
supports_chains=False)
|
||||
self._mode = mode
|
||||
self.read_config('register')
|
||||
|
||||
def handle(self, e):
|
||||
"""Override handle to always match the next key and use the register.
|
||||
@ -290,6 +291,9 @@ class RegisterKeyParser(keyparser.BaseKeyParser):
|
||||
Return:
|
||||
True if event has been handled, False otherwise.
|
||||
"""
|
||||
if super().handle(e):
|
||||
return True
|
||||
|
||||
if utils.keyevent_to_string(e) is None:
|
||||
# this is a modifier key, let it pass and keep going
|
||||
return False
|
||||
@ -323,7 +327,3 @@ class RegisterKeyParser(keyparser.BaseKeyParser):
|
||||
def on_keyconfig_changed(self, mode):
|
||||
"""RegisterKeyParser has no config section (no bindable keys)."""
|
||||
pass
|
||||
|
||||
def execute(self, cmdstr, _keytype, count=None):
|
||||
"""Should never be called on RegisterKeyParser."""
|
||||
assert False
|
||||
|
@ -255,3 +255,8 @@ Feature: Keyboard input
|
||||
And I press the key "a"
|
||||
And I wait for "hints: *" in the log
|
||||
Then no crash should happen
|
||||
|
||||
Scenario: Cancelling key input
|
||||
When I run :record-macro
|
||||
And I press the key "<Escape>"
|
||||
Then "Leaving mode KeyMode.record_macro (reason: leave current)" should be logged
|
||||
|
Loading…
Reference in New Issue
Block a user