Add option to persist current mode on tab change
This commit is contained in:
parent
b684e50cdf
commit
7532db83c4
@ -1235,6 +1235,11 @@ tabs.padding:
|
|||||||
type: Padding
|
type: Padding
|
||||||
desc: Padding (in pixels) around text for tabs.
|
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:
|
tabs.position:
|
||||||
default: top
|
default: top
|
||||||
type: Position
|
type: Position
|
||||||
|
@ -652,6 +652,7 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
|
|
||||||
log.modes.debug("Current tab changed, focusing {!r}".format(tab))
|
log.modes.debug("Current tab changed, focusing {!r}".format(tab))
|
||||||
tab.setFocus()
|
tab.setFocus()
|
||||||
|
if not config.val.tabs.persist_mode_on_change:
|
||||||
for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert,
|
for mode in [usertypes.KeyMode.hint, usertypes.KeyMode.insert,
|
||||||
usertypes.KeyMode.caret, usertypes.KeyMode.passthrough]:
|
usertypes.KeyMode.caret, usertypes.KeyMode.passthrough]:
|
||||||
modeman.leave(self._win_id, mode, 'tab changed', maybe=True)
|
modeman.leave(self._win_id, mode, 'tab changed', maybe=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user