From a97defd5e39cc822f6f5e73c8ae32151ccce01e2 Mon Sep 17 00:00:00 2001 From: Crawl Date: Thu, 8 Nov 2018 06:31:29 +0100 Subject: [PATCH] fix: typos and {Lang} fixes #103 --- src/structures/Activity.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/structures/Activity.ts b/src/structures/Activity.ts index 799d031..b0d5720 100644 --- a/src/structures/Activity.ts +++ b/src/structures/Activity.ts @@ -71,7 +71,10 @@ export default class Acivity implements Disposable { startTimestamp: window.activeTextEditor && previousTimestamp && workspaceElapsedTime ? previousTimestamp : window.activeTextEditor ? new Date().getTime() : null, largeImageKey: largeImageKey ? largeImageKey.image || largeImageKey : 'txt', largeImageText: window.activeTextEditor - ? this._config.get('largeImage')!.replace('{lang}', largeImageKey ? largeImageKey.image || largeImageKey : 'txt').replace('{LANG}', largeImageKey ? (largeImageKey.image || largeImageKey).toUpperCase() : 'TXT') + ? this._config.get('largeImage')! + .replace('{lang}', largeImageKey ? largeImageKey.image || largeImageKey : 'txt') + .replace('{Lang}', largeImageKey ? (largeImageKey.image || largeImageKey).toLowerCase().replace(/^\w/, (c: string) => c.toUpperCase()) : 'Txt') + .replace('{LANG}', largeImageKey ? (largeImageKey.image || largeImageKey).toUpperCase() : 'TXT') || window.activeTextEditor.document.languageId.padEnd(2, '\u200b') : this._config.get('largeImageIdle'), smallImageKey: debug.activeDebugSession ? 'debug' : env.appName.includes('Insiders') ? 'vscode-insiders' : 'vscode', @@ -123,8 +126,8 @@ export default class Acivity implements Disposable { .replace('{lang}', largeImageKey ? largeImageKey.image || largeImageKey : 'txt') .replace('{Lang}', largeImageKey ? (largeImageKey.image || largeImageKey).toLowerCase().replace(/^\w/, (c: string) => c.toUpperCase()) : 'Txt') .replace('{LANG}', largeImageKey ? (largeImageKey.image || largeImageKey).toUpperCase() : 'TXT'); - if (totalLines) raw = raw!.replace('{totalline}', totalLines); - if (size) raw = raw!.replace('{filsize}', size); + if (totalLines) raw = raw!.replace('{totallines}', totalLines); + if (size) raw = raw!.replace('{filesize}', size); if (currentLine) raw = raw!.replace('{currentline}', currentLine); if (currentColumn) raw = raw!.replace('{currentcolumn}', currentColumn);