diff --git a/src/blameStatusBarController.ts b/src/blameActiveLineController.ts similarity index 96% rename from src/blameStatusBarController.ts rename to src/blameActiveLineController.ts index 80ec7d9..025dfed 100644 --- a/src/blameStatusBarController.ts +++ b/src/blameActiveLineController.ts @@ -15,7 +15,7 @@ const activeLineDecoration: TextEditorDecorationType = window.createTextEditorDe } } as DecorationRenderOptions); -export default class BlameStatusBarController extends Disposable { +export default class BlameActiveLineController extends Disposable { private _activeEditorLineDisposable: Disposable | undefined; private _blame: Promise | undefined; @@ -23,15 +23,15 @@ export default class BlameStatusBarController extends Disposable { private _currentLine: number = -1; private _disposable: Disposable; private _editor: TextEditor | undefined; - private _showBlameDebounced: (line: number, editor: TextEditor) => Promise; private _statusBarItem: StatusBarItem | undefined; + private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise; private _uri: GitUri; private _useCaching: boolean; constructor(context: ExtensionContext, private git: GitProvider, private annotationController: BlameAnnotationController) { super(() => this.dispose()); - this._showBlameDebounced = Functions.debounce(this._showBlame, 50); + this._updateBlameDebounced = Functions.debounce(this._updateBlame, 50); this._onConfigure(); @@ -136,7 +136,7 @@ export default class BlameStatusBarController extends Disposable { this._blame = undefined; } - this._showBlame(e.selection.active.line, e); + this._updateBlame(e.selection.active.line, e); } private _onEditorSelectionChanged(e: TextEditorSelectionChangeEvent): void { @@ -147,7 +147,7 @@ export default class BlameStatusBarController extends Disposable { if (line === this._currentLine) return; this._currentLine = line; - this._showBlameDebounced(line, e.textEditor); + this._updateBlameDebounced(line, e.textEditor); } private _onDocumentChanged(e: TextDocumentChangeEvent) { @@ -155,10 +155,10 @@ export default class BlameStatusBarController extends Disposable { if (!this._editor || !TextDocumentComparer.equals(e.document, this._editor.document)) return; this._currentLine = -1; - this._showBlame(this._editor.selections[0].active.line, this._editor); + this._updateBlame(this._editor.selections[0].active.line, this._editor); } - private async _showBlame(line: number, editor: TextEditor) { + private async _updateBlame(line: number, editor: TextEditor) { line = line - this._uri.offset; let commitLine: IGitCommitLine; diff --git a/src/extension.ts b/src/extension.ts index 09250a4..75e4759 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ 'use strict'; import { ExtensionContext, languages, window, workspace } from 'vscode'; +import BlameActiveLineController from './blameActiveLineController'; import BlameAnnotationController from './blameAnnotationController'; -import BlameStatusBarController from './blameStatusBarController'; import { configureCssCharacters } from './blameAnnotationFormatter'; import DiffLineWithPreviousCommand from './commands/diffLineWithPrevious'; import DiffLineWithWorkingCommand from './commands/diffLineWithWorking';