From 99d6da9c9032e244a3dcaeb6f86ca65eeebfbd8c Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 22 Sep 2017 01:01:43 -0400 Subject: [PATCH] Fixes issue with whitespace collapsing in decorations --- src/annotations/annotations.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index 4cdee36..e7f3aa9 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -109,14 +109,14 @@ export class Annotations { } static gutter(commit: GitCommit, format: string, dateFormatOrFormatOptions: string | null | ICommitFormatOptions, renderOptions: IRenderOptions): DecorationOptions { - const content = Strings.pad(CommitFormatter.fromTemplate(format, commit, dateFormatOrFormatOptions), 1, 1); + const message = CommitFormatter.fromTemplate(format, commit, dateFormatOrFormatOptions); return { renderOptions: { before: { ...renderOptions.before, ...{ - contentText: content + contentText: Strings.pad(message.replace(/ /g, GlyphChars.Space), 1, 1) } }, dark: { @@ -210,10 +210,11 @@ export class Annotations { truncateMessageAtNewLine: true, dateFormat: dateFormat } as ICommitFormatOptions); + return { renderOptions: { after: { - contentText: Strings.pad(message, 1, 1) + contentText: Strings.pad(message.replace(/ /g, GlyphChars.Space), 1, 1) }, dark: { after: {