Skip to content

Commit

Permalink
Explorer activity icon unsaved count decoration stays around (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored and aeschli committed Jun 6, 2016
1 parent c215e7c commit 0fe5631
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/vs/workbench/common/editor/untitledEditorInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
mime = mimeFromPath; // take most specific mime type if file path is associated and mime is specific
}
}
return this.instantiationService.createInstance(UntitledEditorModel, content, mime || MIME_TEXT,
this.resource, this.hasAssociatedFilePath);

return this.instantiationService.createInstance(UntitledEditorModel, content, mime || MIME_TEXT, this.resource, this.hasAssociatedFilePath);
}

public matches(otherInput: any): boolean {
Expand All @@ -179,15 +179,15 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {

public dispose(): void {

// Listeners
dispose(this.toUnbind);

// Model
if (this.cachedModel) {
this.cachedModel.dispose();
this.cachedModel = null;
}

// Listeners
dispose(this.toUnbind);

super.dispose();
}
}
2 changes: 2 additions & 0 deletions src/vs/workbench/common/editor/untitledEditorModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ export class UntitledEditorModel extends StringEditorModel implements IEncodingS
public dispose(): void {
super.dispose();

this.dirty = false; // we can no longer be dirty

if (this.textModelChangeListener) {
this.textModelChangeListener.dispose();
this.textModelChangeListener = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class TextFileService extends AbstractTextFileService {

// Save
if (confirm === ConfirmResult.SAVE) {
return this.saveAll(true /* includeUntitled */).then((result) => {
return this.saveAll(true /* includeUntitled */).then(result => {
if (result.results.some((r) => !r.success)) {
return true; // veto if some saves failed
}
Expand All @@ -114,11 +114,11 @@ export class TextFileService extends AbstractTextFileService {
public revertAll(resources?: URI[], force?: boolean): TPromise<ITextFileOperationResult> {

// Revert files
return super.revertAll(resources, force).then((r) => {
return super.revertAll(resources, force).then(r => {

// Revert untitled
let untitledInputs = this.untitledEditorService.getAll(resources);
untitledInputs.forEach((input) => {
untitledInputs.forEach(input => {
if (input) {
input.dispose();

Expand Down

0 comments on commit 0fe5631

Please sign in to comment.