Skip to content

Commit

Permalink
#57618 Cancelling the model update should reset the model update flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Sep 6, 2018
1 parent 39cc093 commit d559704
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ abstract class AbstractFileOutputChannel extends Disposable {
clear(): void {
if (this.modelUpdater.isScheduled()) {
this.modelUpdater.cancel();
this.onUpdateModelCancelled();
}
if (this.model) {
this.model.setValue('');
Expand Down Expand Up @@ -149,6 +150,7 @@ abstract class AbstractFileOutputChannel extends Disposable {

protected onModelCreated(model: ITextModel) { }
protected onModelWillDispose(model: ITextModel) { }
protected onUpdateModelCancelled() { }
protected updateModel() { }

dispose(): void {
Expand Down Expand Up @@ -371,6 +373,10 @@ class FileOutputChannel extends AbstractFileOutputChannel implements OutputChann
this.fileHandler.unwatch();
}

protected onUpdateModelCancelled(): void {
this.updateInProgress = false;
}

private onDidContentChange(): void {
if (!this.updateInProgress) {
this.updateInProgress = true;
Expand Down

0 comments on commit d559704

Please sign in to comment.