From 0bbf600b79fd97904160d9e834e4748ef6da9c30 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 16 Jul 2018 23:46:53 -0400 Subject: [PATCH] Replaces encoded chars with unicode (stops fighting with npm) Preserves spaces in format strings --- package.json | 10 +++++----- src/git/formatters/formatter.ts | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 89a01bb..7f6b80c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gitlens", - "displayName": "GitLens \u2014 Git supercharged", - "description": "Supercharge the Git capabilities built into Visual Studio Code \u2014 Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more", + "displayName": "GitLens — Git supercharged", + "description": "Supercharge the Git capabilities built into Visual Studio Code — Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more", "version": "8.5.0", "author": { "name": "Eric Amodio", @@ -339,7 +339,7 @@ }, "gitlens.currentLine.format": { "type": "string", - "default": "${authorAgoOrDate} \u2022 ${message}", + "default": "${authorAgoOrDate} • ${message}", "description": "Specifies the format of the current line blame annotation\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.currentLine.dateFormat`)\n ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle`\n ${authorAgo} - commit author, relative commit date\n ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle`\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting", "scope": "window" }, @@ -399,7 +399,7 @@ }, "gitlens.explorers.commitFormat": { "type": "string", - "default": "${message} \u00a0\u2022\u00a0 ${authorAgoOrDate} \u00a0 (${id})", + "default": "${message} • ${authorAgoOrDate} (${id})", "description": "Specifies the format of committed changes in the `GitLens` and `GitLens Results` explorers\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.defaultDateFormat`)\\n ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle`\n ${authorAgo} - commit author, relative commit date\n ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle`\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting", "scope": "window" }, @@ -627,7 +627,7 @@ "chorded", "none" ], - "description": "Specifies the keymap to use for GitLens shortcut keys\n `alternate` - adds an alternate set of shortcut keys that start with `Alt` (\u2325 on macOS)\n `chorded` - adds a chorded set of shortcut keys that start with `Ctrl+Alt+G` (`\u2325\u2318G` on macOS)\n `none` - no shortcut keys will be added", + "description": "Specifies the keymap to use for GitLens shortcut keys\n `alternate` - adds an alternate set of shortcut keys that start with `Alt` (⌥ on macOS)\n `chorded` - adds a chorded set of shortcut keys that start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)\n `none` - no shortcut keys will be added", "scope": "window" }, "gitlens.menus": { diff --git a/src/git/formatters/formatter.ts b/src/git/formatters/formatter.ts index 701ed79..fa6d5c2 100644 --- a/src/git/formatters/formatter.ts +++ b/src/git/formatters/formatter.ts @@ -8,6 +8,8 @@ export interface IFormatOptions { type Constructor = new (...args: any[]) => T; +const spaceReplacementRegex = / /g; + export abstract class Formatter { protected _item!: TItem; protected _options!: TOptions; @@ -97,6 +99,8 @@ export abstract class Formatter