mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 17:25:40 -05:00
Fixes overzealous updating on document changes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user