Wrap tabs on :tab-move +/- if tabs->wrap is true.

This commit is contained in:
Panagiotis Ktistakis 2015-12-02 03:17:54 +02:00
parent eff0e4c7cc
commit de3460da3e
2 changed files with 4 additions and 1 deletions

View File

@ -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))

View File

@ -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