Преглед на файлове

Fixes left alignment priority

Adds live update support for status bar alignment
Adds values to description
Adds to README
main
Eric Amodio преди 7 години
родител
ревизия
dbdb77c2c1
променени са 3 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. +1
    -0
      README.md
  2. +1
    -1
      package.json
  3. +6
    -4
      src/blameActiveLineController.ts

+ 1
- 0
README.md Целия файл

@ -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.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.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
## Known Issues

+ 1
- 1
package.json Целия файл

@ -309,7 +309,7 @@
"left",
"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": {
"type": "boolean",

+ 6
- 4
src/blameActiveLineController.ts Целия файл

@ -61,11 +61,13 @@ export class BlameActiveLineController extends Disposable {
if (!Objects.areEquivalent(cfg.statusBar, this._config && this._config.statusBar)) {
changed = true;
if (cfg.statusBar.enabled) {
// 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;
const alignment = cfg.statusBar.alignment !== 'left' ? StatusBarAlignment.Right : StatusBarAlignment.Left;
if (this._statusBarItem !== undefined && this._statusBarItem.alignment !== alignment) {
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;
}
else if (!cfg.statusBar.enabled && this._statusBarItem) {

Зареждане…
Отказ
Запис