Don't handle auto-insert-mode when not needed

This commit is contained in:
Florian Bruhin 2014-05-09 16:43:08 +02:00
parent 5044f98f2e
commit 3c098060d1

View File

@ -252,10 +252,12 @@ class WebView(QWebView):
QApplication.postEvent(self, evt)
@pyqtSlot(bool)
def on_load_finished(self, _ok):
def on_load_finished(self, ok):
"""Handle auto-insert-mode after loading finished."""
if not config.get('input', 'auto-insert-mode'):
return
if modeman.instance().mode == 'insert' or not ok:
return
frame = self.page_.currentFrame()
elem = frame.findFirstElement(
webelem.SELECTORS[webelem.Group.editable_focused])