Merge pull request #3807 from slackhead/tabs.mute_messages

Add option to mute the Last Tab/First Tab messages when tabs.wrap is false
This commit is contained in:
Jay Kamat 2018-04-13 12:11:45 -04:00 committed by GitHub
commit 3f9099613b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -336,13 +336,13 @@ Feature: Tab management
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I run :tab-prev
Then the error "First tab" should be shown
Then "First tab" should be logged
Scenario: :tab-next with last tab without wrap
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I run :tab-next
Then the error "Last tab" should be shown
Then "Last tab" should be logged
Scenario: :tab-prev on first tab with wrap
When I set tabs.wrap to true