mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-17 02:51:47 -05:00
Switches to use a unicode arrow for the external link icon
This commit is contained in:
@@ -6,8 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|||||||
|
|
||||||
## [5.1.0-beta] - 2017-09-15
|
## [5.1.0-beta] - 2017-09-15
|
||||||
### Added
|
### Added
|
||||||
- Adds an external link icon to the `details` hover annotations to run the `Open Commit in Remote` command (`gitlens.openCommitInRemote`)
|
|
||||||
- Adds full (multi-line) commit message to the `details` hover annotations
|
- Adds full (multi-line) commit message to the `details` hover annotations
|
||||||
|
- Adds an external link icon to the `details` hover annotations to run the `Open Commit in Remote` command (`gitlens.openCommitInRemote`)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Optimizes performance of the providing blame annotations, especially for large files (saw a ~78% improvement on some files)
|
- Optimizes performance of the providing blame annotations, especially for large files (saw a ~78% improvement on some files)
|
||||||
|
|||||||
20
package-lock.json
generated
20
package-lock.json
generated
@@ -384,16 +384,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"datauri": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/datauri/-/datauri-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-0JddGrbI8uDOPKQ7qkU5vhLSiaA=",
|
|
||||||
"requires": {
|
|
||||||
"image-size": "0.3.5",
|
|
||||||
"mimer": "0.2.1",
|
|
||||||
"semver": "5.4.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dateformat": {
|
"dateformat": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz",
|
||||||
@@ -1291,11 +1281,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz",
|
||||||
"integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw=="
|
"integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw=="
|
||||||
},
|
},
|
||||||
"image-size": {
|
|
||||||
"version": "0.3.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.3.5.tgz",
|
|
||||||
"integrity": "sha1-gyQOqy+1sAsEqrjHSwRx6cunrYw="
|
|
||||||
},
|
|
||||||
"inflight": {
|
"inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
@@ -1784,11 +1769,6 @@
|
|||||||
"mime-db": "1.30.0"
|
"mime-db": "1.30.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mimer": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/mimer/-/mimer-0.2.1.tgz",
|
|
||||||
"integrity": "sha1-xjxaF/6GQj9RYahdVcPtUYm6r/w="
|
|
||||||
},
|
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
|||||||
@@ -1863,7 +1863,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"applicationinsights": "0.21.0",
|
"applicationinsights": "0.21.0",
|
||||||
"copy-paste": "1.3.0",
|
"copy-paste": "1.3.0",
|
||||||
"datauri": "^1.0.5",
|
|
||||||
"iconv-lite": "0.4.19",
|
"iconv-lite": "0.4.19",
|
||||||
"ignore": "3.3.5",
|
"ignore": "3.3.5",
|
||||||
"lodash.debounce": "4.0.8",
|
"lodash.debounce": "4.0.8",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { DiffWithCommand, OpenCommitInRemoteCommand, ShowQuickCommitDetailsComma
|
|||||||
import { IThemeConfig, themeDefaults } from '../configuration';
|
import { IThemeConfig, themeDefaults } from '../configuration';
|
||||||
import { GlyphChars } from '../constants';
|
import { GlyphChars } from '../constants';
|
||||||
import { CommitFormatter, GitCommit, GitDiffChunkLine, GitService, GitUri, ICommitFormatOptions } from '../gitService';
|
import { CommitFormatter, GitCommit, GitDiffChunkLine, GitService, GitUri, ICommitFormatOptions } from '../gitService';
|
||||||
const Datauri = require('datauri');
|
|
||||||
|
|
||||||
interface IHeatmapConfig {
|
interface IHeatmapConfig {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
@@ -26,25 +25,6 @@ export const endOfLineIndex = 1000000;
|
|||||||
const escapeMarkdownRegEx = /[`\>\#\*\_\-\+\.]/g;
|
const escapeMarkdownRegEx = /[`\>\#\*\_\-\+\.]/g;
|
||||||
// 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___';
|
// 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___';
|
||||||
|
|
||||||
const linkIconSvg = `<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg width="12" height="18" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<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" />
|
|
||||||
</svg>`;
|
|
||||||
|
|
||||||
const themeForegroundColor = '#a0a0a0';
|
|
||||||
let linkIconDataUri: string | undefined;
|
|
||||||
|
|
||||||
function getLinkIconDataUri(foregroundColor: string): string {
|
|
||||||
if (linkIconDataUri === undefined || foregroundColor !== themeForegroundColor) {
|
|
||||||
const datauri = new Datauri();
|
|
||||||
datauri.format('.svg', Strings.interpolate(linkIconSvg, { color: foregroundColor }));
|
|
||||||
linkIconDataUri = datauri.content;
|
|
||||||
foregroundColor = themeForegroundColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
return linkIconDataUri!;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Annotations {
|
export class Annotations {
|
||||||
|
|
||||||
static applyHeatmap(decoration: DecorationOptions, date: Date, now: number) {
|
static applyHeatmap(decoration: DecorationOptions, date: Date, now: number) {
|
||||||
@@ -85,7 +65,7 @@ export class Annotations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openInRemoteCommand = hasRemotes
|
const openInRemoteCommand = hasRemotes
|
||||||
? `${' '.repeat(3)} [})](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote")`
|
? `${' '.repeat(3)} [\`${GlyphChars.ArrowUpRight}\`](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote")`
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
const markdown = new MarkdownString(`[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details") __${commit.author}__, ${commit.fromNow()} _(${commit.formatDate(dateFormat)})_ ${openInRemoteCommand} ${message}`);
|
const markdown = new MarkdownString(`[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details") __${commit.author}__, ${commit.fromNow()} _(${commit.formatDate(dateFormat)})_ ${openInRemoteCommand} ${message}`);
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ export type GlyphChars = '\u21a9' |
|
|||||||
'\u2192' |
|
'\u2192' |
|
||||||
'\u21e8' |
|
'\u21e8' |
|
||||||
'\u2191' |
|
'\u2191' |
|
||||||
|
'\u2197' |
|
||||||
'\u2713' |
|
'\u2713' |
|
||||||
'\u2014' |
|
'\u2014' |
|
||||||
'\u2022' |
|
'\u2022' |
|
||||||
@@ -95,6 +96,7 @@ export const GlyphChars = {
|
|||||||
ArrowRight: '\u2192' as GlyphChars,
|
ArrowRight: '\u2192' as GlyphChars,
|
||||||
ArrowRightHollow: '\u21e8' as GlyphChars,
|
ArrowRightHollow: '\u21e8' as GlyphChars,
|
||||||
ArrowUp: '\u2191' as GlyphChars,
|
ArrowUp: '\u2191' as GlyphChars,
|
||||||
|
ArrowUpRight: '\u2197' as GlyphChars,
|
||||||
Check: '\u2713' as GlyphChars,
|
Check: '\u2713' as GlyphChars,
|
||||||
Dash: '\u2014' as GlyphChars,
|
Dash: '\u2014' as GlyphChars,
|
||||||
Dot: '\u2022' as GlyphChars,
|
Dot: '\u2022' as GlyphChars,
|
||||||
|
|||||||
Reference in New Issue
Block a user