Merge remote-tracking branch 'origin/pr/3323'

This commit is contained in:
Florian Bruhin 2017-11-22 08:00:57 +01:00
commit 94b2a41ed7
2 changed files with 10 additions and 3 deletions

View File

@ -1235,6 +1235,11 @@ tabs.padding:
type: Padding
desc: Padding (in pixels) around text for tabs.
tabs.persist_mode_on_change:
default: false
type: Bool
desc: When switching tabs, retain the current mode.
tabs.position:
default: top
type: Position

View File

@ -652,9 +652,11 @@ class TabbedBrowser(tabwidget.TabWidget):
log.modes.debug("Current tab changed, focusing {!r}".format(tab))
tab.setFocus()
for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert,
usertypes.KeyMode.caret, usertypes.KeyMode.passthrough]:
modeman.leave(self._win_id, mode, 'tab changed', maybe=True)
if not config.val.tabs.persist_mode_on_change:
for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert,
usertypes.KeyMode.caret,
usertypes.KeyMode.passthrough]:
modeman.leave(self._win_id, mode, 'tab changed', maybe=True)
if self._now_focused is not None:
objreg.register('last-focused-tab', self._now_focused, update=True,
scope='window', window=self._win_id)