Fix error message when executing command in wrong mode.
This commit is contained in:
parent
157975b0d4
commit
7d9bd17aff
@ -83,13 +83,13 @@ class Command:
|
|||||||
# of qutebrowser.keyinput.modeman.
|
# of qutebrowser.keyinput.modeman.
|
||||||
curmode = QCoreApplication.instance().modeman.mode
|
curmode = QCoreApplication.instance().modeman.mode
|
||||||
if self.modes is not None and curmode not in self.modes:
|
if self.modes is not None and curmode not in self.modes:
|
||||||
|
mode_names = '/'.join(mode.name for mode in self.modes)
|
||||||
raise PrerequisitesError("{}: This command is only allowed in {} "
|
raise PrerequisitesError("{}: This command is only allowed in {} "
|
||||||
"mode.".format(self.name,
|
"mode.".format(self.name, mode_names))
|
||||||
'/'.join(self.modes)))
|
|
||||||
elif self.not_modes is not None and curmode in self.not_modes:
|
elif self.not_modes is not None and curmode in self.not_modes:
|
||||||
|
mode_names = '/'.join(mode.name for mode in self.not_modes)
|
||||||
raise PrerequisitesError("{}: This command is not allowed in {} "
|
raise PrerequisitesError("{}: This command is not allowed in {} "
|
||||||
"mode.".format(self.name,
|
"mode.".format(self.name, mode_names))
|
||||||
'/'.join(self.not_modes)))
|
|
||||||
if self.needs_js and not QWebSettings.globalSettings().testAttribute(
|
if self.needs_js and not QWebSettings.globalSettings().testAttribute(
|
||||||
QWebSettings.JavascriptEnabled):
|
QWebSettings.JavascriptEnabled):
|
||||||
raise PrerequisitesError("{}: This command needs javascript "
|
raise PrerequisitesError("{}: This command needs javascript "
|
||||||
|
Loading…
Reference in New Issue
Block a user