提交 be7b45d8 编写于 作者: B Benjamin Pasero

grid - tweak events firing less

上级 3d7a9579
......@@ -60,6 +60,9 @@ export class NextEditorService extends Disposable implements INextEditorService
private fileInputFactory: IFileInputFactory;
private lastActiveEditor: IEditorInput;
private lastActiveGroup: INextEditorGroup;
constructor(
@INextEditorGroupsService private nextEditorGroupsService: INextEditorGroupsService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
......@@ -85,6 +88,18 @@ export class NextEditorService extends Disposable implements INextEditorService
}
private onDidActiveGroupChange(group: INextEditorGroup): void {
if (!this.lastActiveGroup) {
return; // ignore the initial root group
}
this.lastActiveGroup = group;
if (!this.lastActiveEditor && !group.activeEditor) {
return; // ignore if we still have no active editor
}
this.lastActiveEditor = group.activeEditor;
this._onDidActiveEditorChange.fire();
}
......
......@@ -32,7 +32,7 @@ export interface INextEditorService {
readonly onDidActiveEditorChange: Event<void>;
/**
* Emitted when the set of currently visible editors changes.
* Emitted when any of the current visible editors changes.
*/
readonly onDidVisibleEditorsChange: Event<void>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册