From 7e88cb7368c753b97d985a1fb08bc73b9d967e00 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 2 Oct 2017 23:21:51 -0400 Subject: [PATCH] Re-adds commit id for consistency Tightens up spacing as well --- src/annotations/annotations.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index 178b2dd..267ce67 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -56,8 +56,11 @@ export class Annotations { let openInRemoteCommand = ''; let showCommitDetailsCommand = ''; if (!commit.isUncommitted) { - if (hasRemotes) openInRemoteCommand = `${' '.repeat(3)} [\`${GlyphChars.ArrowUpRight}\`](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote")   `; - showCommitDetailsCommand = `[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details")   `; + if (hasRemotes) { + openInRemoteCommand = `${' '.repeat(2)} [\`${GlyphChars.ArrowUpRight}\`](${OpenCommitInRemoteCommand.getMarkdownCommandArgs(commit.sha)} "Open in Remote") `; + } + showCommitDetailsCommand = `[\`${commit.shortSha}\`](${ShowQuickCommitDetailsCommand.getMarkdownCommandArgs(commit.sha)} "Show Commit Details")`; + message = commit.message // Escape markdown .replace(escapeMarkdownRegEx, '\\$&') @@ -67,8 +70,11 @@ export class Annotations { .replace(/\n/g, ' \n'); message = `\n\n> ${message}`; } + else { + showCommitDetailsCommand = `\`${commit.shortSha}\``; + } - const markdown = new MarkdownString(`${showCommitDetailsCommand}__${commit.author}__, ${commit.fromNow()}   _(${commit.formatDate(dateFormat)})_ ${openInRemoteCommand}${message}`); + const markdown = new MarkdownString(`${showCommitDetailsCommand}   __${commit.author}__, ${commit.fromNow()}   _(${commit.formatDate(dateFormat)})_ ${openInRemoteCommand}${message}`); markdown.isTrusted = true; return markdown; }