mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Add index to tab
This commit is contained in:
@@ -14,6 +14,7 @@ import { ViewColumn } from 'vs/workbench/api/common/extHostTypes';
|
||||
export interface IEditorTab {
|
||||
label: string;
|
||||
viewColumn: ViewColumn;
|
||||
index: number;
|
||||
resource?: vscode.Uri;
|
||||
viewId?: string;
|
||||
isActive: boolean;
|
||||
@@ -58,12 +59,15 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs {
|
||||
return Object.freeze({
|
||||
label: dto.label,
|
||||
viewColumn: typeConverters.ViewColumn.to(dto.viewColumn),
|
||||
index,
|
||||
resource: URI.revive(dto.resource),
|
||||
viewId: dto.editorId,
|
||||
isActive: dto.isActive
|
||||
});
|
||||
});
|
||||
this._tabs = this._tabs.sort((t1, t2) => t1.viewColumn - t2.viewColumn);
|
||||
this._tabs = this._tabs.sort((t1, t2) => {
|
||||
return t1.viewColumn === t2.viewColumn ? t1.index - t2.index : t1.viewColumn - t2.viewColumn;
|
||||
});
|
||||
const oldActiveTab = this._activeTab;
|
||||
this._activeTab = activeIndex === -1 ? undefined : this._tabs[activeIndex];
|
||||
if (this._activeTab !== oldActiveTab) {
|
||||
|
||||
Reference in New Issue
Block a user