Skip to content

Commit

Permalink
Fix #67658
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Feb 8, 2019
1 parent 2ba52db commit 7afc9b8
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts
Expand Up @@ -413,10 +413,29 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}

private createListeners(): void {
const onModelChange = Event.debounce<URI, URI[]>(this.markersWorkbenchService.markersModel.onDidChange, (uris, uri) => { if (!uris) { uris = []; } uris.push(uri); return uris; }, 0);
const onModelOrActiveEditorChanged = Event.debounce<URI | true, { resources: URI[], activeEditorChanged: boolean }>(Event.any<any>(this.markersWorkbenchService.markersModel.onDidChange, Event.map(this.editorService.onDidActiveEditorChange, () => true)), (result, e) => {
if (!result) {
result = {
resources: [],
activeEditorChanged: false
};
}
if (e === true) {
result.activeEditorChanged = true;
} else {
result.resources.push(e);
}
return result;
}, 0);

this._register(onModelChange(this.onDidChangeModel, this));
this._register(this.editorService.onDidActiveEditorChange(this.onActiveEditorChanged, this));
this._register(onModelOrActiveEditorChanged(({ resources, activeEditorChanged }) => {
if (resources) {
this.onDidChangeModel(resources);
}
if (activeEditorChanged) {
this.onActiveEditorChanged();
}
}, this));
this._register(this.tree.onDidChangeSelection(() => this.onSelected()));
this._register(this.filterAction.onDidChange((event: IMarkersFilterActionChangeEvent) => {
if (event.filterText || event.useFilesExclude) {
Expand Down

0 comments on commit 7afc9b8

Please sign in to comment.