mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-17 02:51:47 -05:00
Makes status bar alignment configurable
This commit is contained in:
committed by
Eric Amodio
parent
0ef1e509a6
commit
263bdc728a
@@ -302,6 +302,15 @@
|
|||||||
"default": null,
|
"default": null,
|
||||||
"description": "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"
|
"description": "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": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "right",
|
||||||
|
"enum": [
|
||||||
|
"left",
|
||||||
|
"right"
|
||||||
|
],
|
||||||
|
"description": "Specifies the blame alignment in the status bar"
|
||||||
|
},
|
||||||
"gitlens.advanced.caching.enabled": {
|
"gitlens.advanced.caching.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": true,
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ 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) {
|
||||||
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(StatusBarAlignment.Right, 1000);
|
// Coerce invalid configuration to the default right alignment
|
||||||
|
const useDefaultAlignment = cfg.statusBar.alignment === 'right' || cfg.statusBar.alignment !== 'left';
|
||||||
|
const alignment = useDefaultAlignment ? StatusBarAlignment.Right : StatusBarAlignment.Left;
|
||||||
|
|
||||||
|
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(alignment, 1000);
|
||||||
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) {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ export interface IStatusBarConfig {
|
|||||||
command: StatusBarCommand;
|
command: StatusBarCommand;
|
||||||
date: 'off' | 'relative' | 'absolute';
|
date: 'off' | 'relative' | 'absolute';
|
||||||
dateFormat: string;
|
dateFormat: string;
|
||||||
|
alignment: 'left' | 'right';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IAdvancedConfig {
|
export interface IAdvancedConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user