diff --git a/README.md b/README.md index 0e4b01c..6b8c76b 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ GitLens is highly customizable and provides many configuration settings to allow |`gitlens.menus.diff.enabled`|Specifies whether diff commands will be added to the context menus |`gitlens.statusBar.enabled`|Specifies whether blame information is shown in the status bar |`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right -|`gitlens.statusBar.command`|"Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick +|`gitlens.statusBar.command`|Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current line commit with the previous. `gitlens.diffWithWorking` - compares the current line commit with the working tree. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick |`gitlens.statusBar.date`|Specifies whether and how the commit date will be shown in the blame status bar. `off` - no date. `relative` - relative date (e.g. 1 day ago). `absolute` - date format specified by `gitlens.statusBar.dateFormat` |`gitlens.statusBar.dateFormat`|Specifies the date format of how absolute dates will be shown in the blame status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats diff --git a/package.json b/package.json index 4b822a1..56225fd 100644 --- a/package.json +++ b/package.json @@ -308,13 +308,14 @@ "gitlens.showBlameHistory", "gitlens.showFileHistory", "gitlens.diffWithPrevious", + "gitlens.diffWithWorking", "gitlens.toggleCodeLens", "gitlens.showQuickCommitDetails", "gitlens.showQuickCommitFileDetails", "gitlens.showQuickFileHistory", "gitlens.showQuickRepoHistory" ], - "description": "Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick" + "description": "Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current line commit with the previous. `gitlens.diffWithWorking` - compares the current line commit with the working tree. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick" }, "gitlens.statusBar.date": { "type": "string", @@ -391,7 +392,7 @@ }, { "command": "gitlens.diffLineWithPrevious", - "title": "Compare Line Commit with Previous", + "title": "Compare Line Commit with Previous", "category": "GitLens" }, { @@ -401,7 +402,7 @@ }, { "command": "gitlens.diffLineWithWorking", - "title": "Compare Line Commit with Working Tree", + "title": "Compare Line Commit with Working Tree", "category": "GitLens" }, { diff --git a/src/blameActiveLineController.ts b/src/blameActiveLineController.ts index 6577f82..a99da0b 100644 --- a/src/blameActiveLineController.ts +++ b/src/blameActiveLineController.ts @@ -3,6 +3,7 @@ import { Functions, Objects } from './system'; import { DecorationInstanceRenderOptions, DecorationOptions, DecorationRenderOptions, Disposable, ExtensionContext, Range, StatusBarAlignment, StatusBarItem, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode'; import { BlameAnnotationController } from './blameAnnotationController'; import { BlameAnnotationFormat, BlameAnnotationFormatter } from './blameAnnotationFormatter'; +import { Commands } from './commands'; import { TextEditorComparer } from './comparers'; import { IBlameConfig, IConfig, StatusBarCommand } from './configuration'; import { DocumentSchemes, ExtensionKey } from './constants'; @@ -244,7 +245,12 @@ export class BlameActiveLineController extends Disposable { this._statusBarItem.tooltip = 'Open File History Explorer'; break; case StatusBarCommand.DiffWithPrevious: - this._statusBarItem.tooltip = 'Compare with Previous Commit'; + this._statusBarItem.command = Commands.DiffLineWithPrevious; + this._statusBarItem.tooltip = 'Compare File with Previous'; + break; + case StatusBarCommand.DiffWithWorking: + this._statusBarItem.command = Commands.DiffLineWithWorking; + this._statusBarItem.tooltip = 'Compare File with Working Tree'; break; case StatusBarCommand.ToggleCodeLens: this._statusBarItem.tooltip = 'Toggle Git CodeLens'; diff --git a/src/configuration.ts b/src/configuration.ts index 681e370..bd686d2 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -73,12 +73,13 @@ export interface ICodeLensesConfig { authors: ICodeLensConfig; } -export type StatusBarCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.toggleCodeLens' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; +export type StatusBarCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.toggleCodeLens' | 'gitlens.diffWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; export const StatusBarCommand = { BlameAnnotate: Commands.ToggleBlame as StatusBarCommand, ShowBlameHistory: Commands.ShowBlameHistory as StatusBarCommand, ShowFileHistory: Commands.ShowFileHistory as CodeLensCommand, DiffWithPrevious: Commands.DiffWithPrevious as StatusBarCommand, + DiffWithWorking: Commands.DiffWithWorking as StatusBarCommand, ToggleCodeLens: Commands.ToggleCodeLens as StatusBarCommand, ShowQuickCommitDetails: Commands.ShowQuickCommitDetails as StatusBarCommand, ShowQuickCommitFileDetails: Commands.ShowQuickCommitFileDetails as StatusBarCommand,