Merge branch 'blyxxyz-ignore-invalid-register-keys'

This commit is contained in:
Florian Bruhin 2017-02-04 18:02:03 +01:00
commit bc20ae9efe
3 changed files with 21 additions and 4 deletions

View File

@ -37,6 +37,7 @@ Fixed
- Fixed various mouse actions (like automatically entering insert mode) not working with Qt 5.8
- Fixed hints sometimes not working with Qt 5.8
- `:enter-mode` now refuses to enter modes which can't be entered manually (which caused crashes).
- `:record-macro` (`q`) now doesn't try to record macros for special keys without a text.
v0.9.1
------

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