Changes the annotation line separator rendering

This commit is contained in:
Eric Amodio
2017-08-17 01:23:06 -04:00
parent 0e338308c6
commit f11c00ceda
6 changed files with 25 additions and 30 deletions

View File

@@ -13,10 +13,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Changed ## Changed
- Changes chat links from Gitter to [Slack](https://join.slack.com/t/vscode-gitlens/shared_invite/MjIxOTgxNDE3NzM0LTE1MDE2Nzk1MTgtMjkwMmZjMzcxNQ) - Changes chat links from Gitter to [Slack](https://join.slack.com/t/vscode-gitlens/shared_invite/MjIxOTgxNDE3NzM0LTE1MDE2Nzk1MTgtMjkwMmZjMzcxNQ)
- Changes the look of the line separators on the gutter blame annotations
## Removed ## Removed
- Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now - Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now
- Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now - Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now
- Removes the `gitlens.theme.annotations.file.hover.separateLines` configuration setting
## Fixed ## Fixed
- Fixes jumpiness when opening a diff to a certain line - Fixes jumpiness when opening a diff to a certain line

View File

@@ -318,14 +318,13 @@ GitLens is highly customizable and provides many configuration settings to allow
|Name | Description |Name | Description
|-----|------------ |-----|------------
|`gitlens.theme.annotations.file.gutter.separateLines`|Specifies whether or not gutter blame annotations will be separated by a small gap |`gitlens.theme.annotations.file.gutter.separateLines`|Specifies whether or not gutter blame annotations will have line separators
|`gitlens.theme.annotations.file.gutter.dark.backgroundColor`|Specifies the dark theme background color of the gutter blame annotations |`gitlens.theme.annotations.file.gutter.dark.backgroundColor`|Specifies the dark theme background color of the gutter blame annotations
|`gitlens.theme.annotations.file.gutter.light.backgroundColor`|Specifies the light theme background color of the gutter blame annotations |`gitlens.theme.annotations.file.gutter.light.backgroundColor`|Specifies the light theme background color of the gutter blame annotations
|`gitlens.theme.annotations.file.gutter.dark.foregroundColor`|Specifies the dark theme foreground color of the gutter blame annotations |`gitlens.theme.annotations.file.gutter.dark.foregroundColor`|Specifies the dark theme foreground color of the gutter blame annotations
|`gitlens.theme.annotations.file.gutter.light.foregroundColor`|Specifies the light theme foreground color of the gutter blame annotations |`gitlens.theme.annotations.file.gutter.light.foregroundColor`|Specifies the light theme foreground color of the gutter blame annotations
|`gitlens.theme.annotations.file.gutter.dark.uncommittedForegroundColor`|Specifies the dark theme foreground color of an uncommitted line in the gutter blame annotations |`gitlens.theme.annotations.file.gutter.dark.uncommittedForegroundColor`|Specifies the dark theme foreground color of an uncommitted line in the gutter blame annotations
|`gitlens.theme.annotations.file.gutter.light.uncommittedForegroundColor`|Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations |`gitlens.theme.annotations.file.gutter.light.uncommittedForegroundColor`|Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations
|`gitlens.theme.annotations.file.hover.separateLines`|Specifies whether or not hover blame annotations will be separated by a small gap (if heatmap is enabled)
|`gitlens.theme.annotations.line.trailing.dark.backgroundColor`|Specifies the dark theme background color of the trailing blame annotation |`gitlens.theme.annotations.line.trailing.dark.backgroundColor`|Specifies the dark theme background color of the trailing blame annotation
|`gitlens.theme.annotations.line.trailing.light.backgroundColor`|Specifies the light theme background color of the trailing blame annotation |`gitlens.theme.annotations.line.trailing.light.backgroundColor`|Specifies the light theme background color of the trailing blame annotation
|`gitlens.theme.annotations.line.trailing.dark.foregroundColor`|Specifies the dark theme foreground color of the trailing blame annotation |`gitlens.theme.annotations.line.trailing.dark.foregroundColor`|Specifies the dark theme foreground color of the trailing blame annotation

View File

@@ -508,11 +508,6 @@
"default": "rgba(0, 188, 242, 0.6)", "default": "rgba(0, 188, 242, 0.6)",
"description": "Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations. Must be a valid css color" "description": "Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations. Must be a valid css color"
}, },
"gitlens.theme.annotations.file.hover.separateLines": {
"type": "boolean",
"default": false,
"description": "Specifies whether or not hover blame annotations will be separated by a small gap (if heatmap is enabled)"
},
"gitlens.theme.annotations.line.trailing.dark.backgroundColor": { "gitlens.theme.annotations.line.trailing.dark.backgroundColor": {
"type": "string", "type": "string",
"default": null, "default": null,

View File

@@ -142,17 +142,18 @@ export class Annotations {
before: { before: {
borderStyle: borderStyle, borderStyle: borderStyle,
borderWidth: borderWidth, borderWidth: borderWidth,
height: cfgFileTheme.separateLines ? 'calc(100% - 1px)' : '100%', height: '100%',
margin: '0 26px 0 0', margin: '0 26px -1px 0'
textDecoration: 'none'
}, },
dark: { dark: {
backgroundColor: cfgFileTheme.dark.backgroundColor || undefined, backgroundColor: cfgFileTheme.dark.backgroundColor || undefined,
color: cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor color: cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor,
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .2)' : 'none'
} as DecorationInstanceRenderOptions, } as DecorationInstanceRenderOptions,
light: { light: {
backgroundColor: cfgFileTheme.light.backgroundColor || undefined, backgroundColor: cfgFileTheme.light.backgroundColor || undefined,
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor,
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .05)' : 'none'
} as DecorationInstanceRenderOptions } as DecorationInstanceRenderOptions
} as IRenderOptions; } as IRenderOptions;
} }
@@ -172,7 +173,7 @@ export class Annotations {
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: '0 0 0 2px', borderWidth: '0 0 0 2px',
contentText: GlyphChars.ZeroWidthSpace, contentText: GlyphChars.ZeroWidthSpace,
height: cfgTheme.annotations.file.hover.separateLines ? 'calc(100% - 1px)' : '100%', height: '100%',
margin: '0 26px 0 0', margin: '0 26px 0 0',
textDecoration: 'none' textDecoration: 'none'
} }

View File

@@ -36,6 +36,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
const offset = this.uri.offset; const offset = this.uri.offset;
const renderOptions = Annotations.gutterRenderOptions(this._config.theme, cfg.heatmap); const renderOptions = Annotations.gutterRenderOptions(this._config.theme, cfg.heatmap);
const dateFormat = this._config.defaultDateFormat; const dateFormat = this._config.defaultDateFormat;
const separateLines = this._config.theme.annotations.file.gutter.separateLines;
const decorations: DecorationOptions[] = []; const decorations: DecorationOptions[] = [];
const document = this.document; const document = this.document;
@@ -58,7 +59,18 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
if (cfg.compact && !compacted) { if (cfg.compact && !compacted) {
// Since we are wiping out the contextText make sure to copy the objects // Since we are wiping out the contextText make sure to copy the objects
gutter.renderOptions = { ...gutter.renderOptions }; gutter.renderOptions = { ...gutter.renderOptions };
gutter.renderOptions.before = { ...gutter.renderOptions.before, ...{ contentText: GlyphChars.Space.repeat(gutter.renderOptions!.before!.contentText!.length) } }; // !.before!.contentText = GlyphChars.Space.repeat(gutter.renderOptions!.before!.contentText!.length); gutter.renderOptions.before = {
...gutter.renderOptions.before,
...{ contentText: GlyphChars.Space.repeat(gutter.renderOptions!.before!.contentText!.length) }
};
if (separateLines) {
gutter.renderOptions.dark = { ...gutter.renderOptions.dark };
gutter.renderOptions.dark.before = { ...gutter.renderOptions.dark.before, ...{ textDecoration: 'none' } };
gutter.renderOptions.light = { ...gutter.renderOptions.light };
gutter.renderOptions.light.before = { ...gutter.renderOptions.light.before, ...{ textDecoration: 'none' } };
}
compacted = true; compacted = true;
} }
@@ -78,16 +90,9 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
} }
compacted = false; compacted = false;
gutter = Annotations.gutter(commit, cfg.format, options, renderOptions); previousSha = l.sha;
// TODO: Remove this "if" once vscode 1.15 ships - since empty lines won't be "missing" anymore -- Woo! gutter = Annotations.gutter(commit, cfg.format, options, renderOptions);
if (cfg.compact) {
const isEmptyOrWhitespace = document.lineAt(line).isEmptyOrWhitespace;
previousSha = isEmptyOrWhitespace ? undefined : l.sha;
}
else {
previousSha = l.sha;
}
if (cfg.heatmap.enabled) { if (cfg.heatmap.enabled) {
Annotations.applyHeatmap(gutter, commit.date, now); Annotations.applyHeatmap(gutter, commit.date, now);

View File

@@ -134,10 +134,6 @@ export interface IThemeConfig {
uncommittedForegroundColor: string | null; uncommittedForegroundColor: string | null;
}; };
}; };
hover: {
separateLines: boolean;
};
}; };
line: { line: {
@@ -181,9 +177,6 @@ export const themeDefaults: IThemeConfig = {
foregroundColor: 'rgb(116, 116, 116)', foregroundColor: 'rgb(116, 116, 116)',
uncommittedForegroundColor: null uncommittedForegroundColor: null
} }
},
hover: {
separateLines: false
} }
}, },
line: { line: {