Add option to mute the Last Tab/First Tab messages when tabs.wrap is false

This commit is contained in:
Slackhead 2018-04-03 16:27:04 +01:00
parent 79823a9a0b
commit 39c08cb582
3 changed files with 19 additions and 2 deletions

View File

@ -257,6 +257,8 @@
|<<tabs.title.format_pinned,tabs.title.format_pinned>>|Format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined.
|<<tabs.width,tabs.width>>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical.
|<<tabs.wrap,tabs.wrap>>|Wrap when changing tabs.
|<<tabs.mute_messages,tabs.mute_messages>>|Mute the First Tab and Last Tab
messages when wrap is set to False.
|<<url.auto_search,url.auto_search>>|What search to start when something else than a URL is entered.
|<<url.default_page,url.default_page>>|Page to open if :open -t/-b/-w is used without URL.
|<<url.incdec_segments,url.incdec_segments>>|URL segments where `:navigate increment/decrement` will search for a number.
@ -3074,6 +3076,14 @@ Type: <<types,Bool>>
Default: +pass:[true]+
[[tabs.mute_messages]]
=== tabs.mute_messages
Mute First Tab and Last Tab messages when tabs.wrap is set to False.
Type: <<types,Bool>>
Default: +pass:[false]+
[[url.auto_search]]
=== url.auto_search
What search to start when something else than a URL is entered.

View File

@ -1022,7 +1022,8 @@ class CommandDispatcher:
elif config.val.tabs.wrap:
self._set_current_index(newidx % self._count())
else:
raise cmdexc.CommandError("First tab")
if not config.val.tabs.mute_messages:
raise cmdexc.CommandError("First tab")
@cmdutils.register(instance='command-dispatcher', scope='window')
@cmdutils.argument('count', count=True)
@ -1042,7 +1043,8 @@ class CommandDispatcher:
elif config.val.tabs.wrap:
self._set_current_index(newidx % self._count())
else:
raise cmdexc.CommandError("Last tab")
if not config.val.tabs.mute_messages:
raise cmdexc.CommandError("Last tab")
def _resolve_buffer_index(self, index):
"""Resolve a buffer index to the tabbedbrowser and tab.

View File

@ -1458,6 +1458,11 @@ tabs.wrap:
type: Bool
desc: Wrap when changing tabs.
tabs.mute_messages:
default: false
type: Bool
desc: Mute the First Tab and Last Tab messages when wrap is set to False.
## url
url.auto_search: