Added debug() logging for next/prev-tab and test scenarios
This commit is contained in:
parent
fac546e9b4
commit
62aa9bdbb3
@ -1021,6 +1021,8 @@ class CommandDispatcher:
|
|||||||
self._set_current_index(newidx)
|
self._set_current_index(newidx)
|
||||||
elif config.val.tabs.wrap:
|
elif config.val.tabs.wrap:
|
||||||
self._set_current_index(newidx % self._count())
|
self._set_current_index(newidx % self._count())
|
||||||
|
else:
|
||||||
|
log.webview.debug("First tab")
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
@cmdutils.argument('count', count=True)
|
@cmdutils.argument('count', count=True)
|
||||||
@ -1039,6 +1041,8 @@ class CommandDispatcher:
|
|||||||
self._set_current_index(newidx)
|
self._set_current_index(newidx)
|
||||||
elif config.val.tabs.wrap:
|
elif config.val.tabs.wrap:
|
||||||
self._set_current_index(newidx % self._count())
|
self._set_current_index(newidx % self._count())
|
||||||
|
else:
|
||||||
|
log.webview.debug("Last tab")
|
||||||
|
|
||||||
def _resolve_buffer_index(self, index):
|
def _resolve_buffer_index(self, index):
|
||||||
"""Resolve a buffer index to the tabbedbrowser and tab.
|
"""Resolve a buffer index to the tabbedbrowser and tab.
|
||||||
|
@ -332,6 +332,18 @@ Feature: Tab management
|
|||||||
- data/numbers/2.txt
|
- data/numbers/2.txt
|
||||||
- data/numbers/3.txt (active)
|
- 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
|
Scenario: :tab-prev on first tab with wrap
|
||||||
When I set tabs.wrap to true
|
When I set tabs.wrap to true
|
||||||
And I open data/numbers/1.txt
|
And I open data/numbers/1.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user