Make it configurable whether to leave insertmode on click

This commit is contained in:
Florian Bruhin 2014-06-23 08:05:52 +02:00
parent 0028bd94cc
commit 593a2fe4ec
2 changed files with 6 additions and 3 deletions

View File

@ -370,6 +370,10 @@ DATA = OrderedDict([
"Whether to switch to insert mode when clicking flash and other "
"plugins."),
('auto-leave-insert-mode',
SettingValue(types.Bool(), 'true'),
"Whether to leave insert mode if a non-editable element is clicked."),
('auto-insert-mode',
SettingValue(types.Bool(), 'true'),
"Whether to automatically enter insert mode if an editable element "

View File

@ -264,10 +264,9 @@ class WebView(QWebView):
log.mouse.debug("Clicked editable element!")
modeman.enter('insert', 'click')
else:
# We don't leave the insert mode here as _is_editable is just an
# approximation, and the user will get annoyed if insertmode is
# left with every click.
log.mouse.debug("Clicked non-editable element!")
if config.get('input', 'auto-leave-insert-mode'):
modeman.maybe_leave('insert', 'click')
def _mousepress_opentarget(self, e):
"""Set the open target when something was clicked.