mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-16 09:29:59 +00:00
focus the next tab after closing a tab - fixes #6325
This commit is contained in:
parent
3e2f93c226
commit
a31cacf4ee
@ -144,7 +144,7 @@ export class AppService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeTab (tab: BaseTabComponent): void {
|
removeTab (tab: BaseTabComponent): void {
|
||||||
const newIndex = Math.max(0, this.tabs.indexOf(tab) - 1)
|
const newIndex = Math.min(this.tabs.length - 2, this.tabs.indexOf(tab))
|
||||||
this.tabs = this.tabs.filter((x) => x !== tab)
|
this.tabs = this.tabs.filter((x) => x !== tab)
|
||||||
if (tab === this._activeTab) {
|
if (tab === this._activeTab) {
|
||||||
this.selectTab(this.tabs[newIndex])
|
this.selectTab(this.tabs[newIndex])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user