提交 a808ce94 编写于 作者: S Sandeep Somavarapu

Fix #16492

上级 c04b0754
...@@ -60,6 +60,7 @@ export class MarkersPanel extends Panel { ...@@ -60,6 +60,7 @@ export class MarkersPanel extends Panel {
private messageBox: HTMLElement; private messageBox: HTMLElement;
private markerFocusContextKey: IContextKey<boolean>; private markerFocusContextKey: IContextKey<boolean>;
private currentFileGotAddedToMarkersData: boolean = false;
constructor( constructor(
@IInstantiationService private instantiationService: IInstantiationService, @IInstantiationService private instantiationService: IInstantiationService,
...@@ -223,14 +224,29 @@ export class MarkersPanel extends Panel { ...@@ -223,14 +224,29 @@ export class MarkersPanel extends Panel {
} }
private onMarkerChanged(changedResources: URI[]) { private onMarkerChanged(changedResources: URI[]) {
this.currentFileGotAddedToMarkersData = this.currentFileGotAddedToMarkersData || this.isCurrentFileGotAddedToMarkersData(changedResources);
this.updateResources(changedResources); this.updateResources(changedResources);
this.delayedRefresh.trigger(() => { this.delayedRefresh.trigger(() => {
this.refreshPanel(); this.refreshPanel();
this.updateRangeHighlights(); this.updateRangeHighlights();
if (this.currentFileGotAddedToMarkersData) {
this.autoReveal(); this.autoReveal();
this.currentFileGotAddedToMarkersData = false;
}
}); });
} }
private isCurrentFileGotAddedToMarkersData(changedResources: URI[]) {
if (!this.currentActiveFile) {
return false;
}
const resourceForCurrentActiveFile = this.getResourceForCurrentActiveFile();
if (resourceForCurrentActiveFile) {
return false;
}
return changedResources.some(r => r.toString() === this.currentActiveFile.toString());
}
private onEditorsChanged(): void { private onEditorsChanged(): void {
this.currentActiveFile = toResource(this.editorService.getActiveEditorInput(), { filter: 'file' }); this.currentActiveFile = toResource(this.editorService.getActiveEditorInput(), { filter: 'file' });
this.autoReveal(); this.autoReveal();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册