Disallow caret mode with QtWebEngine

This commit is contained in:
Florian Bruhin 2017-02-04 21:43:32 +01:00
parent fd29528e4f
commit d3f359e490

View File

@ -265,10 +265,17 @@ class ModeManager(QObject):
m = usertypes.KeyMode[mode]
except KeyError:
raise cmdexc.CommandError("Mode {} does not exist!".format(mode))
backend = usertypes.arg2backend[objreg.get('args').backend]
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))
elif (m == usertypes.KeyMode.caret and
backend == usertypes.Backend.QtWebEngine):
raise cmdexc.CommandError("Caret mode is not supported with "
"QtWebEngine yet.")
self.enter(m, 'command')
@pyqtSlot(usertypes.KeyMode, str, bool)