Merge branch 'enter-mode-blacklist' of https://github.com/blyxxyz/qutebrowser into blyxxyz-enter-mode-blacklist

This commit is contained in:
Florian Bruhin 2017-02-04 17:52:16 +01:00
commit 8cdf2f61c7
2 changed files with 10 additions and 0 deletions

View File

@ -265,6 +265,10 @@ class ModeManager(QObject):
m = usertypes.KeyMode[mode]
except KeyError:
raise cmdexc.CommandError("Mode {} does not exist!".format(mode))
if m in [usertypes.KeyMode.hint, usertypes.KeyMode.command,
usertypes.KeyMode.yesno, usertypes.KeyMode.prompt]:
raise cmdexc.CommandError(
"Mode {} can't be entered manually!".format(mode))
self.enter(m, 'command')
@pyqtSlot(usertypes.KeyMode, str, bool)

View File

@ -635,3 +635,9 @@ Feature: Various utility commands.
And I run :command-accept
And I set general -> private-browsing to false
Then the message "blah" should be shown
## Modes blacklisted for :enter-mode
Scenario: Trying to enter command mode with :enter-mode
When I run :enter-mode command
Then the error "Mode command can't be entered manually!" should be shown