fix #15: pad a zws at the end of single character languages
This commit is contained in:
parent
c8916182c5
commit
51b3448a69
1 changed files with 7 additions and 10 deletions
|
@ -5,12 +5,9 @@ import { setInterval, clearInterval } from 'timers';
|
||||||
import {
|
import {
|
||||||
commands,
|
commands,
|
||||||
debug,
|
debug,
|
||||||
DebugSession,
|
|
||||||
Disposable,
|
Disposable,
|
||||||
env,
|
env,
|
||||||
ExtensionContext,
|
ExtensionContext,
|
||||||
TextDocument,
|
|
||||||
TextDocumentChangeEvent,
|
|
||||||
window,
|
window,
|
||||||
workspace,
|
workspace,
|
||||||
WorkspaceFolder
|
WorkspaceFolder
|
||||||
|
@ -96,12 +93,12 @@ function initRPC(clientID: string): void {
|
||||||
setActivity();
|
setActivity();
|
||||||
// Set the activity once on ready
|
// Set the activity once on ready
|
||||||
setTimeout(() => rpc.setActivity(activity), 500);
|
setTimeout(() => rpc.setActivity(activity), 500);
|
||||||
eventHandlers.add(workspace.onDidChangeTextDocument((e: TextDocumentChangeEvent) => setActivity()))
|
eventHandlers.add(workspace.onDidChangeTextDocument(() => setActivity()))
|
||||||
.add(workspace.onDidOpenTextDocument((e: TextDocument) => setActivity()))
|
.add(workspace.onDidOpenTextDocument(() => setActivity()))
|
||||||
.add(workspace.onDidCloseTextDocument((e: TextDocument) => setActivity()))
|
.add(workspace.onDidCloseTextDocument(() => setActivity()))
|
||||||
.add(debug.onDidChangeActiveDebugSession((e: DebugSession) => setActivity()))
|
.add(debug.onDidChangeActiveDebugSession(() => setActivity()))
|
||||||
.add(debug.onDidStartDebugSession((e: DebugSession) => setActivity()))
|
.add(debug.onDidStartDebugSession(() => setActivity()))
|
||||||
.add(debug.onDidTerminateDebugSession((e: DebugSession) => setActivity()));
|
.add(debug.onDidTerminateDebugSession(() => setActivity()));
|
||||||
// Make sure to listen to the close event and dispose and destroy everything accordingly.
|
// Make sure to listen to the close event and dispose and destroy everything accordingly.
|
||||||
rpc.transport.once('close', () => {
|
rpc.transport.once('close', () => {
|
||||||
if (!config.get('enabled')) return;
|
if (!config.get('enabled')) return;
|
||||||
|
@ -182,7 +179,7 @@ function setActivity(): void {
|
||||||
: 'txt',
|
: 'txt',
|
||||||
largeImageText: window.activeTextEditor
|
largeImageText: window.activeTextEditor
|
||||||
? config.get('largeImage')
|
? config.get('largeImage')
|
||||||
|| window.activeTextEditor.document.languageId
|
|| window.activeTextEditor.document.languageId.padEnd(2, '\u200b')
|
||||||
: config.get('largeImageIdle'),
|
: config.get('largeImageIdle'),
|
||||||
smallImageKey: debug.activeDebugSession
|
smallImageKey: debug.activeDebugSession
|
||||||
? 'debug'
|
? 'debug'
|
||||||
|
|
Loading…
Reference in a new issue