Skip to content

Commit f11c00c

Browse files
committed
Changes the annotation line separator rendering
1 parent 0e33830 commit f11c00c

File tree

6 files changed

+25
-30
lines changed

6 files changed

+25
-30
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1313

1414
## Changed
1515
- Changes chat links from Gitter to [Slack](https://join.slack.com/t/vscode-gitlens/shared_invite/MjIxOTgxNDE3NzM0LTE1MDE2Nzk1MTgtMjkwMmZjMzcxNQ)
16+
- Changes the look of the line separators on the gutter blame annotations
1617

1718
## Removed
1819
- Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now
1920
- Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now
21+
- Removes the `gitlens.theme.annotations.file.hover.separateLines` configuration setting
2022

2123
## Fixed
2224
- Fixes jumpiness when opening a diff to a certain line

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,13 @@ GitLens is highly customizable and provides many configuration settings to allow
318318

319319
|Name | Description
320320
|-----|------------
321-
|`gitlens.theme.annotations.file.gutter.separateLines`|Specifies whether or not gutter blame annotations will be separated by a small gap
321+
|`gitlens.theme.annotations.file.gutter.separateLines`|Specifies whether or not gutter blame annotations will have line separators
322322
|`gitlens.theme.annotations.file.gutter.dark.backgroundColor`|Specifies the dark theme background color of the gutter blame annotations
323323
|`gitlens.theme.annotations.file.gutter.light.backgroundColor`|Specifies the light theme background color of the gutter blame annotations
324324
|`gitlens.theme.annotations.file.gutter.dark.foregroundColor`|Specifies the dark theme foreground color of the gutter blame annotations
325325
|`gitlens.theme.annotations.file.gutter.light.foregroundColor`|Specifies the light theme foreground color of the gutter blame annotations
326326
|`gitlens.theme.annotations.file.gutter.dark.uncommittedForegroundColor`|Specifies the dark theme foreground color of an uncommitted line in the gutter blame annotations
327327
|`gitlens.theme.annotations.file.gutter.light.uncommittedForegroundColor`|Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations
328-
|`gitlens.theme.annotations.file.hover.separateLines`|Specifies whether or not hover blame annotations will be separated by a small gap (if heatmap is enabled)
329328
|`gitlens.theme.annotations.line.trailing.dark.backgroundColor`|Specifies the dark theme background color of the trailing blame annotation
330329
|`gitlens.theme.annotations.line.trailing.light.backgroundColor`|Specifies the light theme background color of the trailing blame annotation
331330
|`gitlens.theme.annotations.line.trailing.dark.foregroundColor`|Specifies the dark theme foreground color of the trailing blame annotation

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,6 @@
508508
"default": "rgba(0, 188, 242, 0.6)",
509509
"description": "Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations. Must be a valid css color"
510510
},
511-
"gitlens.theme.annotations.file.hover.separateLines": {
512-
"type": "boolean",
513-
"default": false,
514-
"description": "Specifies whether or not hover blame annotations will be separated by a small gap (if heatmap is enabled)"
515-
},
516511
"gitlens.theme.annotations.line.trailing.dark.backgroundColor": {
517512
"type": "string",
518513
"default": null,

src/annotations/annotations.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,18 @@ export class Annotations {
142142
before: {
143143
borderStyle: borderStyle,
144144
borderWidth: borderWidth,
145-
height: cfgFileTheme.separateLines ? 'calc(100% - 1px)' : '100%',
146-
margin: '0 26px 0 0',
147-
textDecoration: 'none'
145+
height: '100%',
146+
margin: '0 26px -1px 0'
148147
},
149148
dark: {
150149
backgroundColor: cfgFileTheme.dark.backgroundColor || undefined,
151-
color: cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor
150+
color: cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor,
151+
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .2)' : 'none'
152152
} as DecorationInstanceRenderOptions,
153153
light: {
154154
backgroundColor: cfgFileTheme.light.backgroundColor || undefined,
155-
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor
155+
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor,
156+
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .05)' : 'none'
156157
} as DecorationInstanceRenderOptions
157158
} as IRenderOptions;
158159
}
@@ -172,7 +173,7 @@ export class Annotations {
172173
borderStyle: 'solid',
173174
borderWidth: '0 0 0 2px',
174175
contentText: GlyphChars.ZeroWidthSpace,
175-
height: cfgTheme.annotations.file.hover.separateLines ? 'calc(100% - 1px)' : '100%',
176+
height: '100%',
176177
margin: '0 26px 0 0',
177178
textDecoration: 'none'
178179
}

src/annotations/gutterBlameAnnotationProvider.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
3636
const offset = this.uri.offset;
3737
const renderOptions = Annotations.gutterRenderOptions(this._config.theme, cfg.heatmap);
3838
const dateFormat = this._config.defaultDateFormat;
39+
const separateLines = this._config.theme.annotations.file.gutter.separateLines;
3940

4041
const decorations: DecorationOptions[] = [];
4142
const document = this.document;
@@ -58,7 +59,18 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
5859
if (cfg.compact && !compacted) {
5960
// Since we are wiping out the contextText make sure to copy the objects
6061
gutter.renderOptions = { ...gutter.renderOptions };
61-
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);
62+
gutter.renderOptions.before = {
63+
...gutter.renderOptions.before,
64+
...{ contentText: GlyphChars.Space.repeat(gutter.renderOptions!.before!.contentText!.length) }
65+
};
66+
67+
if (separateLines) {
68+
gutter.renderOptions.dark = { ...gutter.renderOptions.dark };
69+
gutter.renderOptions.dark.before = { ...gutter.renderOptions.dark.before, ...{ textDecoration: 'none' } };
70+
gutter.renderOptions.light = { ...gutter.renderOptions.light };
71+
gutter.renderOptions.light.before = { ...gutter.renderOptions.light.before, ...{ textDecoration: 'none' } };
72+
}
73+
6274
compacted = true;
6375
}
6476

@@ -78,16 +90,9 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
7890
}
7991

8092
compacted = false;
81-
gutter = Annotations.gutter(commit, cfg.format, options, renderOptions);
93+
previousSha = l.sha;
8294

83-
// TODO: Remove this "if" once vscode 1.15 ships - since empty lines won't be "missing" anymore -- Woo!
84-
if (cfg.compact) {
85-
const isEmptyOrWhitespace = document.lineAt(line).isEmptyOrWhitespace;
86-
previousSha = isEmptyOrWhitespace ? undefined : l.sha;
87-
}
88-
else {
89-
previousSha = l.sha;
90-
}
95+
gutter = Annotations.gutter(commit, cfg.format, options, renderOptions);
9196

9297
if (cfg.heatmap.enabled) {
9398
Annotations.applyHeatmap(gutter, commit.date, now);

src/configuration.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ export interface IThemeConfig {
134134
uncommittedForegroundColor: string | null;
135135
};
136136
};
137-
138-
hover: {
139-
separateLines: boolean;
140-
};
141137
};
142138

143139
line: {
@@ -181,9 +177,6 @@ export const themeDefaults: IThemeConfig = {
181177
foregroundColor: 'rgb(116, 116, 116)',
182178
uncommittedForegroundColor: null
183179
}
184-
},
185-
hover: {
186-
separateLines: false
187180
}
188181
},
189182
line: {

0 commit comments

Comments
 (0)