Merge branch 'forkbong-tab-move-wrap'
This commit is contained in:
commit
71d1aed041
@ -160,6 +160,7 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* John ShaggyTwoDope Jenkins
|
* John ShaggyTwoDope Jenkins
|
||||||
* Peter Vilim
|
* Peter Vilim
|
||||||
* Jonas Schürmann
|
* Jonas Schürmann
|
||||||
|
* Panagiotis Ktistakis
|
||||||
* Jimmy
|
* Jimmy
|
||||||
* skinnay
|
* skinnay
|
||||||
* error800
|
* error800
|
||||||
@ -167,7 +168,6 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Halfwit
|
* Halfwit
|
||||||
* Felix Van der Jeugt
|
* Felix Van der Jeugt
|
||||||
* rikn00
|
* rikn00
|
||||||
* Panagiotis Ktistakis
|
|
||||||
* Martin Zimmermann
|
* Martin Zimmermann
|
||||||
* Brian Jackson
|
* Brian Jackson
|
||||||
* sbinix
|
* sbinix
|
||||||
|
@ -900,6 +900,9 @@ class CommandDispatcher:
|
|||||||
new_idx = self._current_index() - delta
|
new_idx = self._current_index() - delta
|
||||||
elif direction == '+': # pragma: no branch
|
elif direction == '+': # pragma: no branch
|
||||||
new_idx = self._current_index() + delta
|
new_idx = self._current_index() + delta
|
||||||
|
|
||||||
|
if config.get('tabs', 'wrap'):
|
||||||
|
new_idx %= self._count()
|
||||||
else: # pragma: no cover
|
else: # pragma: no cover
|
||||||
raise ValueError("Invalid direction '{}'!".format(direction))
|
raise ValueError("Invalid direction '{}'!".format(direction))
|
||||||
|
|
||||||
|
@ -384,13 +384,37 @@ Feature: Tab management
|
|||||||
- data/numbers/2.txt
|
- data/numbers/2.txt
|
||||||
|
|
||||||
Scenario: :tab-move with relative position and too big count.
|
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/2.txt in a new tab
|
||||||
And I open data/numbers/3.txt in a new tab
|
And I open data/numbers/3.txt in a new tab
|
||||||
And I run :tab-focus 1
|
And I run :tab-focus 1
|
||||||
And I run :tab-move + with count 3
|
And I run :tab-move + with count 3
|
||||||
Then the error "Can't move tab to position 4!" should be shown
|
Then the error "Can't move tab to position 4!" should be shown
|
||||||
|
|
||||||
|
Scenario: :tab-move with relative position (positive) and wrap
|
||||||
|
When I set tabs -> wrap to true
|
||||||
|
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-move +
|
||||||
|
Then the following tabs should be open:
|
||||||
|
- data/numbers/3.txt (active)
|
||||||
|
- data/numbers/1.txt
|
||||||
|
- data/numbers/2.txt
|
||||||
|
|
||||||
|
Scenario: :tab-move with relative position (negative), wrap and count
|
||||||
|
When I set tabs -> wrap to true
|
||||||
|
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
|
||||||
|
And I run :tab-move - with count 8
|
||||||
|
Then the following tabs should be open:
|
||||||
|
- data/numbers/2.txt
|
||||||
|
- data/numbers/1.txt (active)
|
||||||
|
- data/numbers/3.txt
|
||||||
|
|
||||||
Scenario: Make sure :tab-move retains metadata
|
Scenario: Make sure :tab-move retains metadata
|
||||||
When I open data/title.html
|
When I open data/title.html
|
||||||
And I open data/hello.txt in a new tab
|
And I open data/hello.txt in a new tab
|
||||||
|
Loading…
Reference in New Issue
Block a user