mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-04 09:45:36 -05:00
Fixes left alignment priority
Adds live update support for status bar alignment Adds values to description Adds to README
This commit is contained in:
@@ -209,6 +209,7 @@ GitLens is highly customizable and provides many configuration settings to allow
|
|||||||
|`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 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.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.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
|
|`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
|
||||||
|
|`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right
|
||||||
|`gitlens.insiders`|Opts into the insiders channel -- provides access to upcoming features
|
|`gitlens.insiders`|Opts into the insiders channel -- provides access to upcoming features
|
||||||
|
|
||||||
## Known Issues
|
## Known Issues
|
||||||
|
|||||||
@@ -309,7 +309,7 @@
|
|||||||
"left",
|
"left",
|
||||||
"right"
|
"right"
|
||||||
],
|
],
|
||||||
"description": "Specifies the blame alignment in the status bar"
|
"description": "Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right"
|
||||||
},
|
},
|
||||||
"gitlens.advanced.caching.enabled": {
|
"gitlens.advanced.caching.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|||||||
@@ -61,11 +61,13 @@ export class BlameActiveLineController extends Disposable {
|
|||||||
if (!Objects.areEquivalent(cfg.statusBar, this._config && this._config.statusBar)) {
|
if (!Objects.areEquivalent(cfg.statusBar, this._config && this._config.statusBar)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
if (cfg.statusBar.enabled) {
|
if (cfg.statusBar.enabled) {
|
||||||
// Coerce invalid configuration to the default right alignment
|
const alignment = cfg.statusBar.alignment !== 'left' ? StatusBarAlignment.Right : StatusBarAlignment.Left;
|
||||||
const useDefaultAlignment = cfg.statusBar.alignment === 'right' || cfg.statusBar.alignment !== 'left';
|
if (this._statusBarItem !== undefined && this._statusBarItem.alignment !== alignment) {
|
||||||
const alignment = useDefaultAlignment ? StatusBarAlignment.Right : StatusBarAlignment.Left;
|
this._statusBarItem.dispose();
|
||||||
|
this._statusBarItem = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(alignment, 1000);
|
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(alignment, alignment === StatusBarAlignment.Right ? 1000 : 0);
|
||||||
this._statusBarItem.command = cfg.statusBar.command;
|
this._statusBarItem.command = cfg.statusBar.command;
|
||||||
}
|
}
|
||||||
else if (!cfg.statusBar.enabled && this._statusBarItem) {
|
else if (!cfg.statusBar.enabled && this._statusBarItem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user