mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-23 01:35:37 -05:00
Rewrites blame annotation controller and provider - fixes whitespace issues, reduces overhead, and provides better performance Rewrites status bar blame support - reduces overhead and provides better performance Adds showFileHistory command to status bar Renames showHistory to showFileHistory Fixes log to use iso 8601 for dates
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
'use strict';
|
|
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
|
import BlameAnnotationController from '../blameAnnotationController';
|
|
import { EditorCommand } from './commands';
|
|
import { Commands } from '../constants';
|
|
import { Logger } from '../logger';
|
|
|
|
export default class ToggleBlameCommand extends EditorCommand {
|
|
constructor(private annotationController: BlameAnnotationController) {
|
|
super(Commands.ToggleBlame);
|
|
}
|
|
|
|
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri, sha?: string): Promise<any> {
|
|
try {
|
|
if (sha) {
|
|
return this.annotationController.toggleBlameAnnotation(editor, sha);
|
|
}
|
|
|
|
return this.annotationController.toggleBlameAnnotation(editor, editor.selection.active.line);
|
|
}
|
|
catch (ex) {
|
|
Logger.error('GitLens.ToggleBlameCommand', ex);
|
|
return window.showErrorMessage(`Unable to show blame annotations. See output channel for more details`);
|
|
}
|
|
}
|
|
} |