fixed #9829 - show the active pane's title as the first in the split tab title

This commit is contained in:
Eugene 2024-08-24 13:05:05 +02:00
parent f4992c3f70
commit 0241623d27
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4

View file

@ -821,7 +821,13 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
if (this.disableDynamicTitle) { if (this.disableDynamicTitle) {
return return
} }
this.setTitle([...new Set(this.getAllTabs().map(x => x.title))].join(' | ')) const titles = [
this.getFocusedTab()?.title,
...this.getAllTabs()
.filter(x => x !== this.getFocusedTab())
.map(x => x.title),
]
this.setTitle([...new Set(titles)].join(' | '))
} }
private attachTabView (tab: BaseTabComponent) { private attachTabView (tab: BaseTabComponent) {
@ -837,6 +843,10 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
}) })
} }
tab.subscribeUntilDestroyed(
this.observeUntilChildDetached(tab, tab.focused$),
() => this.updateTitle(),
)
tab.subscribeUntilDestroyed( tab.subscribeUntilDestroyed(
this.observeUntilChildDetached(tab, tab.titleChange$), this.observeUntilChildDetached(tab, tab.titleChange$),
() => this.updateTitle(), () => this.updateTitle(),