Adds "on" state to file annotation command

Adds "progress" state to file annotation command
This commit is contained in:
Eric Amodio
2017-08-15 01:35:50 -04:00
parent 787e0e6aa1
commit 00cdd2e375
17 changed files with 146 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
'use strict';
import { Functions } from '../system';
// import { Functions } from '../system';
import { Disposable, ExtensionContext, TextDocument, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode';
import { FileAnnotationType } from '../annotations/annotationController';
import { TextDocumentComparer } from '../comparers';
@@ -43,19 +43,12 @@ import { WhitespaceController } from './whitespaceController';
async clear() {
if (this.editor !== undefined) {
try {
if (this.decoration !== undefined) {
this.editor.setDecorations(this.decoration, []);
}
if (this.highlightDecoration !== undefined) {
this.editor.setDecorations(this.highlightDecoration, []);
}
// I have no idea why the decorators sometimes don't get removed, but if they don't try again with a tiny delay
await Functions.wait(1);
if (this.highlightDecoration === undefined) return;
this.editor.setDecorations(this.highlightDecoration, []);
if (this.decoration !== undefined) {
this.editor.setDecorations(this.decoration, []);
}
}
catch (ex) { }