Merge branch 'ignore-invalid-register-keys' of https://github.com/blyxxyz/qutebrowser into blyxxyz-ignore-invalid-register-keys

This commit is contained in:
Florian Bruhin 2017-02-04 17:55:07 +01:00
commit 007065b63c
2 changed files with 20 additions and 4 deletions

View File

@ -294,12 +294,12 @@ class RegisterKeyParser(keyparser.CommandKeyParser):
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
key = e.text()
if key == '' or utils.keyevent_to_string(e) is None:
# this is not a proper register key, let it pass and keep going
return False
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
macro_recorder = objreg.get('macro-recorder')

View File

@ -260,3 +260,19 @@ Feature: Keyboard input
When I run :record-macro
And I press the key "<Escape>"
Then "Leaving mode KeyMode.record_macro (reason: leave current)" should be logged
Scenario: Ignoring non-register keys
Given I open data/scroll/simple.html
And I run :tab-only
When I run :scroll down with count 2
And I wait until the scroll position changed
And I run :record-macro
And I press the key "<Menu>"
And I press the key "c"
And I run :scroll up
And I wait until the scroll position changed
And I run :record-macro
And I run :run-macro
And I press the key "c"
And I wait until the scroll position changed to 0/0
Then the page should not be scrolled