提交 ac1dcd7c 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #10590 from ramamurthynagaraj/issue_10556

Fixes #10556: considering non open files dirty count using file dirty event
...@@ -20,11 +20,12 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding'; ...@@ -20,11 +20,12 @@ import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
import {IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup} from 'vs/workbench/common/editor'; import {IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup} from 'vs/workbench/common/editor';
import {SaveAllAction} from 'vs/workbench/parts/files/browser/fileActions'; import {SaveAllAction} from 'vs/workbench/parts/files/browser/fileActions';
import {AdaptiveCollapsibleViewletView} from 'vs/workbench/browser/viewlet'; 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 {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 {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 {IUntitledEditorService} from 'vs/workbench/services/untitled/common/untitledEditorService';
import {CloseAllEditorsAction} from 'vs/workbench/browser/parts/editor/editorActions'; import {CloseAllEditorsAction} from 'vs/workbench/browser/parts/editor/editorActions';
import {IEventService} from 'vs/platform/event/common/event';
const $ = dom.emmet; const $ = dom.emmet;
...@@ -54,7 +55,8 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { ...@@ -54,7 +55,8 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
@IConfigurationService private configurationService: IConfigurationService, @IConfigurationService private configurationService: IConfigurationService,
@IKeybindingService keybindingService: IKeybindingService, @IKeybindingService keybindingService: IKeybindingService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService, @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); 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 { ...@@ -130,6 +132,9 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
// Also handle configuration updates // Also handle configuration updates
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); 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 // 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 => { this.toDispose.push(this.viewletService.onDidViewletOpen(viewlet => {
if (viewlet.getId() === VIEWLET_ID) { if (viewlet.getId() === VIEWLET_ID) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册