Added debug() logging for next/prev-tab and test scenarios

This commit is contained in:
Slackhead 2018-04-09 02:03:02 +01:00
parent fac546e9b4
commit 62aa9bdbb3
2 changed files with 16 additions and 0 deletions

View File

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

View File

@ -332,6 +332,18 @@ Feature: Tab management
- data/numbers/2.txt
- data/numbers/3.txt (active)
Scenario: :tab-prev on first tab without wrap
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I run :tab-prev
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 "Last tab" should be logged
Scenario: :tab-prev on first tab with wrap
When I set tabs.wrap to true
And I open data/numbers/1.txt