Always leave hint mode

- Also handle invalid URLs properly through catching the QtValueError
This commit is contained in:
Jay Kamat 2018-10-16 18:42:37 -07:00
parent 3d5caba7d4
commit 0e327c4ec4
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -584,14 +584,18 @@ class TabbedBrowser(QWidget):
@pyqtSlot()
def on_cur_load_started(self):
"""Leave insert/hint mode when loading started."""
try:
url = self.current_url()
except qtutils.QtValueError:
url = None
if config.instance.get('input.insert_mode.leave_on_load',
url=self.current_url()):
url=url):
modeman.leave(self._win_id, usertypes.KeyMode.insert,
'load started', maybe=True)
modeman.leave(self._win_id, usertypes.KeyMode.hint,
'load started', maybe=True)
else:
log.modes.debug("Ignoring leave_on_load request due to setting.")
modeman.leave(self._win_id, usertypes.KeyMode.hint,
'load started', maybe=True)
@pyqtSlot(browsertab.AbstractTab, str)
def on_title_changed(self, tab, text):