diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 6c48a0afe..4fad5f8fb 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -900,6 +900,8 @@ class CommandDispatcher: new_idx = self._current_index() - delta elif direction == '+': # pragma: no branch new_idx = self._current_index() + delta + if config.get('tabs', 'wrap'): + new_idx = new_idx % self._count() else: # pragma: no cover raise ValueError("Invalid direction '{}'!".format(direction)) diff --git a/tests/integration/features/tabs.feature b/tests/integration/features/tabs.feature index 561caf996..d40c4c70a 100644 --- a/tests/integration/features/tabs.feature +++ b/tests/integration/features/tabs.feature @@ -384,7 +384,8 @@ Feature: Tab management - data/numbers/2.txt Scenario: :tab-move with relative position and too big count. - When I open data/numbers/1.txt + When I set tabs -> wrap to false + And I open data/numbers/1.txt And I open data/numbers/2.txt in a new tab And I open data/numbers/3.txt in a new tab And I run :tab-focus 1