Select the last focused tab when running ':tab-focus <current tab number>'
This commit is contained in:
parent
2ffb10badf
commit
f28d523225
@ -1076,10 +1076,11 @@ class CommandDispatcher:
|
|||||||
last tab.
|
last tab.
|
||||||
count: The tab index to focus, starting with 1.
|
count: The tab index to focus, starting with 1.
|
||||||
"""
|
"""
|
||||||
if index == 'last':
|
index = count if count is not None else index
|
||||||
|
|
||||||
|
if index in ('last', self._current_index() + 1):
|
||||||
self._tab_focus_last()
|
self._tab_focus_last()
|
||||||
return
|
return
|
||||||
index = count if count is not None else index
|
|
||||||
|
|
||||||
if index is None:
|
if index is None:
|
||||||
self.tab_next()
|
self.tab_next()
|
||||||
|
@ -236,6 +236,18 @@ Feature: Tab management
|
|||||||
- data/numbers/2.txt
|
- data/numbers/2.txt
|
||||||
- data/numbers/3.txt
|
- data/numbers/3.txt
|
||||||
|
|
||||||
|
Scenario: :tab-focus with current tab number
|
||||||
|
When 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-focus 3
|
||||||
|
And I run :tab-focus 1
|
||||||
|
Then the following tabs should be open:
|
||||||
|
- data/numbers/1.txt (active)
|
||||||
|
- data/numbers/2.txt
|
||||||
|
- data/numbers/3.txt
|
||||||
|
|
||||||
Scenario: :tab-focus with -1
|
Scenario: :tab-focus with -1
|
||||||
When I open data/numbers/1.txt
|
When 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
|
||||||
|
Loading…
Reference in New Issue
Block a user