Browse Source

Adds control over the active line annotation colors

main
Eric Amodio 7 years ago
parent
commit
0875cc12d5
4 changed files with 30 additions and 3 deletions
  1. +3
    -1
      README.md
  2. +11
    -1
      package.json
  3. +14
    -1
      src/blameActiveLineController.ts
  4. +2
    -0
      src/configuration.ts

+ 3
- 1
README.md View File

@ -5,7 +5,7 @@
# GitLens
GitLens **supercharges** the built-in Visual Studio Code Git capabilities. It helps you to **visualize code authorship** at a glance via inline blame annotations and CodeLens, seamlessly **navigate and explore** the history of a file or branch, **gain valuable insights** via powerful comparision commands, and so much more.
GitLens **supercharges** the built-in Visual Studio Code Git capabilities. It helps you to **visualize code authorship** at a glance via inline blame annotations and CodeLens, **seamlessly navigate and explore** the history of a file or branch, **gain valuable insights** via powerful comparision commands, and so much more.
GitLens provides an unobtrusive blame annotation at the end of the selected line, a status bar item showing the commit author and date of the selected line, CodeLens showing the most recent commit and # of authors of the file and/or code block, and many commands for exploring commits and histories, comparing and navigating revisions, stash access, repository status, and more. GitLens is also [highly customizable](#extension-settings) to meet your specific needs — find CodeLens intrusive or the selected line blame annotation distracting — no problem, it is easy to [turn them off or change how they behave](#extension-settings).
@ -194,6 +194,8 @@ GitLens is highly customizable and provides many configuration settings to allow
|`gitlens.blame.annotation.dateFormat`|Specifies the date format of how absolute dates will be shown in the blame annotations. See https://momentjs.com/docs/#/displaying/format/ for valid formats
|`gitlens.blame.annotation.message`|Specifies whether the commit message will be shown in the blame annotations. Applies only to the `expanded` & `trailing` annotation styles
|`gitlens.blame.annotation.activeLine`|Specifies whether and how to show blame annotations on the active line. `off` - no annotation. `inline` - adds a trailing annotation to the active line. `hover` - adds hover annotation to the active line. `both` - adds both `inline` and `hover` annotations
|`gitlens.blame.annotation.activeLineDarkColor`|Specifies the color of the active line blame annotation to use with a dark theme. Must be a valid css color
|`gitlens.blame.annotation.activeLineLightColor`|Specifies the color of the active line blame annotation to use with a light theme. Must be a valid css color
|`gitlens.codeLens.visibility`|Specifies when CodeLens will be triggered in the active document. `auto` - automatically. `ondemand` - only when requested. `off` - disables all active document CodeLens
|`gitlens.codeLens.location`|Specifies where CodeLens will be rendered in the active document. `all` - render at the top of the document, on container-like (classes, modules, etc), and on member-like (methods, functions, properties, etc) lines. `document+containers` - render at the top of the document and on container-like lines. `document` - only render at the top of the document. `custom` - rendering controlled by `gitlens.codeLens.locationCustomSymbols`
|`gitlens.codeLens.locationCustomSymbols`|Specifies the set of document symbols to render active document CodeLens on. Must be a member of `SymbolKind`

+ 11
- 1
package.json View File

@ -11,7 +11,7 @@
},
"license": "SEE LICENSE IN LICENSE",
"displayName": "GitLens",
"description": "Supercharge the built-in Visual Studio Code's Git capabilities Visualize code authorship at a glance via inline blame annotations and CodeLens, seamlessly navigate and explore the history of a file or branch, gain valuable insights via powerful comparision commands, and so much more",
"description": "Supercharge the built-in Visual Studio Code's Git capabilities \u2014 Visualize code authorship at a glance via inline blame annotations and CodeLens, seamlessly navigate and explore the history of a file or branch, gain valuable insights via powerful comparision commands, and so much more",
"badges": [
{
"url": "https://badges.gitter.im/vscode-gitlens/Lobby.svg",
@ -107,6 +107,16 @@
],
"description": "Specifies whether and how to show blame annotations on the active line. `off` - no annotation. `inline` - adds a trailing annotation to the active line. `hover` - adds hover annotation to the active line. `both` - adds both `inline` and `hover` annotations"
},
"gitlens.blame.annotation.activeLineDarkColor": {
"type": "string",
"default": "rgba(153, 153, 153, 0.35)",
"description": "Specifies the color of the active line blame annotation to use with a dark theme. Must be a valid css color"
},
"gitlens.blame.annotation.activeLineLightColor": {
"type": "string",
"default": "rgba(153, 153, 153, 0.35)",
"description": "Specifies the color of the active line blame annotation to use with a light theme. Must be a valid css color"
},
"gitlens.codeLens.visibility": {
"type": "string",
"default": "auto",

+ 14
- 1
src/blameActiveLineController.ts View File

@ -83,6 +83,10 @@ export class BlameActiveLineController extends Disposable {
this._editor.setDecorations(activeLineDecoration, []);
}
}
if (!Objects.areEquivalent(config.blame.annotation.activeLineDarkColor, this._config && this._config.blame.annotation.activeLineDarkColor) ||
!Objects.areEquivalent(config.blame.annotation.activeLineLightColor, this._config && this._config.blame.annotation.activeLineLightColor)) {
changed = true;
}
this._config = config;
@ -322,8 +326,17 @@ export class BlameActiveLineController extends Disposable {
hoverMessage: hoverMessage,
renderOptions: {
after: {
color: 'rgba(153, 153, 153, 0.35)',
contentText: annotation
},
dark: {
after: {
color: this._config.blame.annotation.activeLineDarkColor || 'rgba(153, 153, 153, 0.35)'
}
},
light: {
after: {
color: this._config.blame.annotation.activeLineLightColor || 'rgba(153, 153, 153, 0.35)'
}
}
} as DecorationInstanceRenderOptions
} as DecorationOptions;

+ 2
- 0
src/configuration.ts View File

@ -19,6 +19,8 @@ export interface IBlameConfig {
dateFormat: string;
message: boolean;
activeLine: 'off' | 'inline' | 'hover' | 'both';
activeLineDarkColor: string;
activeLineLightColor: string;
};
}

||||||
x
 
000:0
Loading…
Cancel
Save