mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 01:35:36 -05:00
Fixes issue with undo not causing annotations to reappear
Might address #42
This commit is contained in:
@@ -157,10 +157,6 @@ export class BlameActiveLineController extends Disposable {
|
||||
// Make sure this is for the editor we are tracking
|
||||
if (!TextEditorComparer.equals(this._editor, e.editor)) return;
|
||||
|
||||
const line = this._editor.selection.active.line;
|
||||
if (line === this._currentLine) return;
|
||||
this._currentLine = line;
|
||||
|
||||
this._updateBlame(this._editor.selection.active.line, this._editor);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,15 +62,20 @@ export class BlameabilityTracker extends Disposable {
|
||||
private _onTextDocumentChanged(e: TextDocumentChangeEvent) {
|
||||
if (!TextDocumentComparer.equals(this._editor && this._editor.document, e && e.document)) return;
|
||||
|
||||
this._unsubscribeToDocumentChanges();
|
||||
this.updateBlameability(false);
|
||||
// Can't unsubscribe here because undo doesn't trigger any other event
|
||||
//this._unsubscribeToDocumentChanges();
|
||||
//this.updateBlameability(false);
|
||||
|
||||
// We have to defer because isDirty is not reliable inside this event
|
||||
setTimeout(() => this.updateBlameability(!e.document.isDirty), 1);
|
||||
}
|
||||
|
||||
private _onTextDocumentSaved(e: TextDocument) {
|
||||
if (!TextDocumentComparer.equals(this._editor && this._editor.document, e)) return;
|
||||
|
||||
this._subscribeToDocumentChanges();
|
||||
this.updateBlameability(true);
|
||||
// Don't need to resubscribe as we aren't unsubscribing on document changes anymore
|
||||
//this._subscribeToDocumentChanges();
|
||||
this.updateBlameability(!e.isDirty);
|
||||
}
|
||||
|
||||
private _subscribeToDocumentChanges() {
|
||||
|
||||
Reference in New Issue
Block a user