Browse Source

Fixes overzealous updating on document changes

main
Eric Amodio 8 years ago
parent
commit
9b92c48759
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/blameActiveLineController.ts

+ 6
- 1
src/blameActiveLineController.ts View File

@ -23,6 +23,7 @@ export default class BlameActiveLineController extends Disposable {
private _currentLine: number = -1;
private _disposable: Disposable;
private _editor: TextEditor | undefined;
private _editorIsDirty: boolean;
private _statusBarItem: StatusBarItem | undefined;
private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise<void>;
private _uri: GitUri;
@ -153,7 +154,11 @@ export default class BlameActiveLineController extends Disposable {
private _onDocumentChanged(e: TextDocumentChangeEvent) {
// Make sure this is for the editor we are tracking
if (!this._editor || !TextDocumentComparer.equals(e.document, this._editor.document)) return;
this._currentLine = -1;
const line = this._editor.selections[0].active.line;
if (line === this._currentLine && this._editorIsDirty === this._editor.document.isDirty) return;
this._currentLine = line;
this._editorIsDirty = this._editor.document.isDirty;
this._updateBlame(this._editor.selections[0].active.line, this._editor);
}

Loading…
Cancel
Save