Skip to content

Commit 99d6da9

Browse files
committed
Fixes issue with whitespace collapsing in decorations
1 parent 0eb202b commit 99d6da9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/annotations/annotations.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ export class Annotations {
109109
}
110110

111111
static gutter(commit: GitCommit, format: string, dateFormatOrFormatOptions: string | null | ICommitFormatOptions, renderOptions: IRenderOptions): DecorationOptions {
112-
const content = Strings.pad(CommitFormatter.fromTemplate(format, commit, dateFormatOrFormatOptions), 1, 1);
112+
const message = CommitFormatter.fromTemplate(format, commit, dateFormatOrFormatOptions);
113113

114114
return {
115115
renderOptions: {
116116
before: {
117117
...renderOptions.before,
118118
...{
119-
contentText: content
119+
contentText: Strings.pad(message.replace(/ /g, GlyphChars.Space), 1, 1)
120120
}
121121
},
122122
dark: {
@@ -210,10 +210,11 @@ export class Annotations {
210210
truncateMessageAtNewLine: true,
211211
dateFormat: dateFormat
212212
} as ICommitFormatOptions);
213+
213214
return {
214215
renderOptions: {
215216
after: {
216-
contentText: Strings.pad(message, 1, 1)
217+
contentText: Strings.pad(message.replace(/ /g, GlyphChars.Space), 1, 1)
217218
},
218219
dark: {
219220
after: {

0 commit comments

Comments
 (0)