mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Adds safety for debounced timing
This commit is contained in:
@@ -165,7 +165,7 @@ export class BlameActiveLineController extends Disposable {
|
|||||||
this._onActiveTextEditorChanged(window.activeTextEditor);
|
this._onActiveTextEditorChanged(window.activeTextEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent): void {
|
private async _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent): Promise<void> {
|
||||||
// Make sure this is for the editor we are tracking
|
// Make sure this is for the editor we are tracking
|
||||||
if (!this._blameable || !TextEditorComparer.equals(this._editor, e.textEditor)) return;
|
if (!this._blameable || !TextEditorComparer.equals(this._editor, e.textEditor)) return;
|
||||||
|
|
||||||
@@ -173,6 +173,10 @@ export class BlameActiveLineController extends Disposable {
|
|||||||
if (line === this._currentLine) return;
|
if (line === this._currentLine) return;
|
||||||
this._currentLine = line;
|
this._currentLine = line;
|
||||||
|
|
||||||
|
if (!this._uri && e.textEditor) {
|
||||||
|
this._uri = await GitUri.fromUri(e.textEditor.document.uri, this.git);
|
||||||
|
}
|
||||||
|
|
||||||
this._updateBlameDebounced(line, e.textEditor);
|
this._updateBlameDebounced(line, e.textEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user