From 62aa9bdbb35b30ac89a5356c0971ddb49bad3474 Mon Sep 17 00:00:00 2001 From: Slackhead Date: Mon, 9 Apr 2018 02:03:02 +0100 Subject: [PATCH] Added debug() logging for next/prev-tab and test scenarios --- qutebrowser/browser/commands.py | 4 ++++ tests/end2end/features/tabs.feature | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index e2a95215d..60844029f 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -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. diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 6e089e13c..1841ef9c9 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -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