diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts index d07cca01b027ad9f97830fe0b78095c204521d67..e3566c490f890479ca50d0a3d6b642ccaad7cbe9 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts @@ -20,11 +20,12 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding'; import {IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup} from 'vs/workbench/common/editor'; import {SaveAllAction} from 'vs/workbench/parts/files/browser/fileActions'; import {AdaptiveCollapsibleViewletView} from 'vs/workbench/browser/viewlet'; -import {ITextFileService, IFilesConfiguration, VIEWLET_ID, AutoSaveMode} from 'vs/workbench/parts/files/common/files'; +import {ITextFileService, IFilesConfiguration, VIEWLET_ID, AutoSaveMode, EventType as FileEventType} from 'vs/workbench/parts/files/common/files'; import {IViewletService} from 'vs/workbench/services/viewlet/common/viewletService'; import {Renderer, DataSource, Controller, AccessibilityProvider, ActionProvider, OpenEditor, DragAndDrop} from 'vs/workbench/parts/files/browser/views/openEditorsViewer'; import {IUntitledEditorService} from 'vs/workbench/services/untitled/common/untitledEditorService'; import {CloseAllEditorsAction} from 'vs/workbench/browser/parts/editor/editorActions'; +import {IEventService} from 'vs/platform/event/common/event'; const $ = dom.emmet; @@ -54,7 +55,8 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { @IConfigurationService private configurationService: IConfigurationService, @IKeybindingService keybindingService: IKeybindingService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IViewletService private viewletService: IViewletService + @IViewletService private viewletService: IViewletService, + @IEventService private eventService: IEventService ) { super(actionRunner, OpenEditorsView.computeExpandedBodySize(editorGroupService.getStacksModel()), !!settings[OpenEditorsView.MEMENTO_COLLAPSED], nls.localize('openEditosrSection', "Open Editors Section"), messageService, keybindingService, contextMenuService); @@ -130,6 +132,9 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { // Also handle configuration updates this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + // Also handle dirty count indicator #10556 + this.toDispose.push(this.eventService.addListener2(FileEventType.FILE_DIRTY, (e) => this.updateDirtyIndicator())); + // We are not updating the tree while the viewlet is not visible. Thus refresh when viewlet becomes visible #6702 this.toDispose.push(this.viewletService.onDidViewletOpen(viewlet => { if (viewlet.getId() === VIEWLET_ID) {