Skip to content

Commit 6c2cde1

Browse files
committed
Adding property for positioning the status bar view
Fixes waderyan#25
1 parent 5d87bb3 commit 6c2cde1

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2.3.0 (March xx, 2018) [WIP]
44

55
* Feature: Atempting to auto detect if you use a known git web interface [#15](https://github.com/Sertion/vscode-gitblame/issues/15) (Thanks to [@Fidge123](https://github.com/Fidge123), [@sabrehagen](https://github.com/sabrehagen), [@henvic](https://github.com/henvic), and [@neerolyte](https://github.com/neerolyte))
6+
* Feature: Added `gitblame.statusBarPositionPriority` for moving the status bar view [#25](https://github.com/Sertion/vscode-gitblame/issues/25) (Thanks to [@jvoigt](https://github.com/jvoigt))
67
* Fix: Merging `GitBlame` and `GitBlameController` to `GitBlame`
78
* Fix: Renaming `GitBlameFile*` to `GitFile*`
89
* Fix: Rewrote all the tests
@@ -36,7 +37,7 @@
3637
This will be updating the major version as we are changing what the exposed command is called.
3738

3839
* Fix: Change name of the command to `gitblame.quickInfo` (was `extension.blame`)
39-
* Fix: Updating the _Known issues_ link to the new issue tracker as all old issuer are resolved
40+
* Fix: Updating the _Known issues_ link to the new issue tracker as all old issues are resolved
4041
* Fix: Moved to TypeScript 2.4.1
4142
* Fix: Cleaning imports
4243
* Fix: Remove Q&A-section from vscode marketplace

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ See Git Blame information in the status bar for the currently selected line.
5151
- message in the status bar about the current line when no commit can be found
5252
- available tokens:
5353
- _No available tokens_
54+
- `gitblame.statusBarPositionPriority` (`number`)
55+
- priority where the status bar view should be placed
56+
- Higher value should be placed further to the left
5457
- `gitblame.progressSpinner` (`array` of `string`, default `["$(sync~spin)"]`)
5558
- an array of strings that will be displayed in sequence to denote progress while blaming files in larger repositories
5659
- supports [Octoicons](https://octicons.github.com/) with the `~spin` suffix for spin action

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
"type": "string",
129129
"default": "Not Committed Yet",
130130
"description": "Customize the status bar message"
131+
},
132+
"gitblame.statusBarPositionPriority": {
133+
"type": "number",
134+
"description": "Priority where the status bar view should be placed"
131135
}
132136
}
133137
}

src/util/property.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum Properties {
99
ProgressSpinner = "progressSpinner",
1010
StatusBarMessageFormat = "statusBarMessageFormat",
1111
StatusBarMessageNoCommit = "statusBarMessageNoCommit",
12+
StatusBarPositionPriority = "statusBarPositionPriority",
1213
}
1314

1415
export class Property {
@@ -65,7 +66,9 @@ export class Property {
6566

6667
private getProperties(): void {
6768
const properties = {
68-
commitUrl: this.getPropertyFromConfiguration(Properties.CommitUrl),
69+
commitUrl: this.getPropertyFromConfiguration(
70+
Properties.CommitUrl,
71+
),
6972
ignoreWhitespace: this.getPropertyFromConfiguration(
7073
Properties.IgnoreWhitespace,
7174
),
@@ -75,7 +78,9 @@ export class Property {
7578
internalHashLength: this.getPropertyFromConfiguration(
7679
Properties.InternalHashLength,
7780
),
78-
logLevel: this.getPropertyFromConfiguration(Properties.LogLevel),
81+
logLevel: this.getPropertyFromConfiguration(
82+
Properties.LogLevel,
83+
),
7984
progressSpinner: this.getPropertyFromConfiguration(
8085
Properties.ProgressSpinner,
8186
),
@@ -85,6 +90,9 @@ export class Property {
8590
statusBarMessageNoCommit: this.getPropertyFromConfiguration(
8691
Properties.StatusBarMessageNoCommit,
8792
),
93+
statusBarPositionPriority: this.getPropertyFromConfiguration(
94+
Properties.StatusBarPositionPriority,
95+
),
8896
};
8997

9098
this.properties = properties;

src/view.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { StatusBarAlignment, StatusBarItem, window } from "vscode";
22

33
import { GitBlame } from "./git/blame";
44
import { IGitCommitInfo } from "./interfaces";
5+
import { Properties, Property } from "./util/property";
56
import { Spinner } from "./util/spinner";
67
import { TextDecorator } from "./util/textdecorator";
78

@@ -24,6 +25,7 @@ export class StatusBarView {
2425
private constructor() {
2526
this.statusBarItem = window.createStatusBarItem(
2627
StatusBarAlignment.Left,
28+
Property.get(Properties.StatusBarPositionPriority),
2729
);
2830
this.spinner = new Spinner();
2931
}

0 commit comments

Comments
 (0)