mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 08:40:29 -04:00
Merge from vscode b12f623603e2fc1c5b3037115fa37c1a6acc4165 (#6760)
This commit is contained in:
@@ -74,7 +74,7 @@ export interface IEditorOpeningEvent extends IEditorIdentifier {
|
||||
* Allows to prevent the opening of an editor by providing a callback
|
||||
* that will be executed instead. By returning another editor promise
|
||||
* it is possible to override the opening with another editor. It is ok
|
||||
* to return a promise that resolves to NULL to prevent the opening
|
||||
* to return a promise that resolves to `undefined` to prevent the opening
|
||||
* alltogether.
|
||||
*/
|
||||
prevent(callback: () => undefined | Promise<IEditor | undefined>): void;
|
||||
|
||||
@@ -382,7 +382,19 @@ export class ContributableViewsModel extends Disposable {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (this.getViewOrder(a) - this.getViewOrder(b)) || (a.id < b.id ? -1 : 1);
|
||||
return (this.getViewOrder(a) - this.getViewOrder(b)) || this.getGroupOrderResult(a, b) || (a.id < b.id ? -1 : 1);
|
||||
}
|
||||
|
||||
private getGroupOrderResult(a: IViewDescriptor, b: IViewDescriptor) {
|
||||
if (!a.group || !b.group) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (a.group === b.group) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return a.group < b.group ? -1 : 1;
|
||||
}
|
||||
|
||||
private getViewOrder(viewDescriptor: IViewDescriptor): number {
|
||||
|
||||
Reference in New Issue
Block a user