Skip to content

Commit 079f7b7

Browse files
committed
Switches to use a unicode arrow for the external link icon
1 parent bedc1a0 commit 079f7b7

File tree

5 files changed

+4
-43
lines changed

5 files changed

+4
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
66

77
## [5.1.0-beta] - 2017-09-15
88
### Added
9-
- Adds an external link icon to the `details` hover annotations to run the `Open Commit in Remote` command (`gitlens.openCommitInRemote`)
109
- Adds full (multi-line) commit message to the `details` hover annotations
10+
- Adds an external link icon to the `details` hover annotations to run the `Open Commit in Remote` command (`gitlens.openCommitInRemote`)
1111

1212
### Changed
1313
- Optimizes performance of the providing blame annotations, especially for large files (saw a ~78% improvement on some files)

package-lock.json

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,6 @@
18631863
"dependencies": {
18641864
"applicationinsights": "0.21.0",
18651865
"copy-paste": "1.3.0",
1866-
"datauri": "^1.0.5",
18671866
"iconv-lite": "0.4.19",
18681867
"ignore": "3.3.5",
18691868
"lodash.debounce": "4.0.8",

src/annotations/annotations.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { DiffWithCommand, OpenCommitInRemoteCommand, ShowQuickCommitDetailsComma
44
import { IThemeConfig, themeDefaults } from '../configuration';
55
import { GlyphChars } from '../constants';
66
import { CommitFormatter, GitCommit, GitDiffChunkLine, GitService, GitUri, ICommitFormatOptions } from '../gitService';
7-
const Datauri = require('datauri');
87

98
interface IHeatmapConfig {
109
enabled: boolean;
@@ -26,25 +25,6 @@ export const endOfLineIndex = 1000000;
2625
const escapeMarkdownRegEx = /[`\>\#\*\_\-\+\.]/g;
2726
// const sampleMarkdown = '## message `not code` *not important* _no underline_ \n> don\'t quote me \n- don\'t list me \n+ don\'t list me \n1. don\'t list me \nnot h1 \n=== \nnot h2 \n---\n***\n---\n___';
2827

29-
const linkIconSvg = `<?xml version="1.0" encoding="utf-8"?>
30-
<svg width="12" height="18" version="1.1" xmlns="http://www.w3.org/2000/svg">
31-
<path fill="\${color}" d="m11,14l1,0l0,3c0,0.55 -0.45,1 -1,1l-10,0c-0.55,0 -1,-0.45 -1,-1l0,-10c0,-0.55 0.45,-1 1,-1l3,0l0,1l-3,0l0,10l10,0l0,-3l0,0zm-5,-8l2.25,2.25l-3.25,3.25l1.5,1.5l3.25,-3.25l2.25,2.25l0,-6l-6,0l0,0z" />
32-
</svg>`;
33-
34-
const themeForegroundColor = '#a0a0a0';
35-
let linkIconDataUri: string | undefined;
36-
37-
function getLinkIconDataUri(foregroundColor: string): string {
38-
if (linkIconDataUri === undefined || foregroundColor !== themeForegroundColor) {
39-
const datauri = new Datauri();
40-
datauri.format('.svg', Strings.interpolate(linkIconSvg, { color: foregroundColor }));
41-
linkIconDataUri = datauri.content;
42-
foregroundColor = themeForegroundColor;
43-
}
44-
45-
return linkIconDataUri!;
46-
}
47-
4828
export class Annotations {
4929

5030
static applyHeatmap(decoration: DecorationOptions, date: Date, now: number) {
@@ -85,7 +65,7 @@ export class Annotations {
8565
}
8666

8767
const openInRemoteCommand = hasRemotes
88-
? `${'&nbsp;'.repeat(3)} [![](${getLinkIconDataUri(themeForegroundColor)})](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote")`
68+
? `${'&nbsp;'.repeat(3)} [\`${GlyphChars.ArrowUpRight}\`](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote")`
8969
: '';
9070

9171
const markdown = new MarkdownString(`[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details") &nbsp; __${commit.author}__, ${commit.fromNow()} &nbsp; _(${commit.formatDate(dateFormat)})_ ${openInRemoteCommand} &nbsp; ${message}`);

src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export type GlyphChars = '\u21a9' |
8080
'\u2192' |
8181
'\u21e8' |
8282
'\u2191' |
83+
'\u2197' |
8384
'\u2713' |
8485
'\u2014' |
8586
'\u2022' |
@@ -95,6 +96,7 @@ export const GlyphChars = {
9596
ArrowRight: '\u2192' as GlyphChars,
9697
ArrowRightHollow: '\u21e8' as GlyphChars,
9798
ArrowUp: '\u2191' as GlyphChars,
99+
ArrowUpRight: '\u2197' as GlyphChars,
98100
Check: '\u2713' as GlyphChars,
99101
Dash: '\u2014' as GlyphChars,
100102
Dot: '\u2022' as GlyphChars,

0 commit comments

Comments
 (0)