Cancel register key input with escape
This commit is contained in:
parent
d8d7b42c43
commit
75c996c13e
@ -290,6 +290,10 @@ class RegisterKeyParser(keyparser.BaseKeyParser):
|
||||
Return:
|
||||
True if event has been handled, False otherwise.
|
||||
"""
|
||||
if e.key() == Qt.Key_Escape:
|
||||
self.request_leave.emit(self._mode, "register key cancelled", True)
|
||||
return True
|
||||
|
||||
if utils.keyevent_to_string(e) is None:
|
||||
# this is a modifier key, let it pass and keep going
|
||||
return 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: register key cancelled)" should be logged
|
||||
|
Loading…
Reference in New Issue
Block a user