This commit is contained in:
arza 2026-01-07 17:35:24 -08:00 committed by GitHub
commit ed00f7250a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 2 deletions

View File

@ -903,6 +903,10 @@ class TabbedBrowser(QWidget):
"on_current_changed got called with invalid index {}"
.format(idx))
return
self._tab_insert_idx_left = self.widget.currentIndex()
self._tab_insert_idx_right = self.widget.currentIndex() + 1
if self._now_focused is tab:
return
log.modes.debug("Current tab changed, focusing {!r}".format(tab))
tab.setFocus()
@ -928,8 +932,6 @@ class TabbedBrowser(QWidget):
self.current_tab_changed.emit(tab)
self.cur_search_match_changed.emit(tab.search.match)
QTimer.singleShot(0, self._update_window_title)
self._tab_insert_idx_left = self.widget.currentIndex()
self._tab_insert_idx_right = self.widget.currentIndex() + 1
@pyqtSlot()
def on_cmd_return_pressed(self):

View File

@ -455,6 +455,27 @@ Feature: Tab management
- data/numbers/3.txt
"""
Scenario: :tab-focus last after moving current tab
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-move 2
And I run :tab-focus last
Then the following tabs should be open:
- data/numbers/1.txt
- data/numbers/3.txt
- data/numbers/2.txt (active)
Scenario: :tab-focus last after closing a lower number tab
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-close with count 1
And I run :tab-focus last
Then the following tabs should be open:
- data/numbers/2.txt (active)
- data/numbers/3.txt
# tab-prev/tab-next
Scenario: :tab-prev
@ -772,6 +793,13 @@ Feature: Tab management
title: Test title
"""
Scenario: :tab-move in insert mode
When I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I run :enter-mode insert
And I run :tab-move 1
Then "Leaving mode KeyMode.insert (reason: tab changed)" should not be logged
# :tab-clone
Scenario: :tab-clone with -b and -w