From 3a38f6ae391be398e373a82507b974680e577822 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 15 May 2017 01:44:41 -0400 Subject: [PATCH] Increases debounce on cursor movement to reduce lag --- src/blameActiveLineController.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/blameActiveLineController.ts b/src/blameActiveLineController.ts index f5819d9..1fca9e8 100644 --- a/src/blameActiveLineController.ts +++ b/src/blameActiveLineController.ts @@ -32,7 +32,7 @@ export class BlameActiveLineController extends Disposable { constructor(context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker, private annotationController: BlameAnnotationController) { super(() => this.dispose()); - this._updateBlameDebounced = Functions.debounce(this._updateBlame, 50); + this._updateBlameDebounced = Functions.debounce(this._updateBlame, 250); this._onConfigurationChanged(); @@ -112,10 +112,8 @@ export class BlameActiveLineController extends Disposable { private isEditorBlameable(editor: TextEditor | undefined): boolean { if (editor === undefined || editor.document === undefined) return false; - const scheme = editor.document.uri.scheme; - if (scheme !== DocumentSchemes.File && scheme !== DocumentSchemes.Git && scheme !== DocumentSchemes.GitLensGit) return false; - - if (editor.document.isUntitled && scheme !== DocumentSchemes.Git && scheme !== DocumentSchemes.GitLensGit) return false; + if (!this.git.isTrackable(editor.document.uri)) return false; + if (editor.document.isUntitled && editor.document.uri.scheme === DocumentSchemes.File) return false; return this.git.isEditorBlameable(editor); }