From 0453e63f7847ec21633556f58c650066235a8807 Mon Sep 17 00:00:00 2001 From: Steven Guh Date: Wed, 24 Nov 2021 19:06:52 -0800 Subject: [PATCH] Ensure consistency of use of full width characters --- src/menu/repeaterMenu.ts | 6 +++--- src/menu/transientMenu.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/menu/repeaterMenu.ts b/src/menu/repeaterMenu.ts index 6141626..f37a480 100644 --- a/src/menu/repeaterMenu.ts +++ b/src/menu/repeaterMenu.ts @@ -1,6 +1,6 @@ import { CommandRelay } from "../commandRelay"; import { StatusBar } from "../statusBar"; -import { pipe, toFullWidthKey, toSpecializedKey } from "../utils"; +import { toFullWidthKey, toFullWidthSpecializedKey, toSpecializedKey } from "../utils"; import { BaseWhichKeyMenu, BaseWhichKeyMenuItem, BaseWhichKeyQuickPickItem, OptionalBaseWhichKeyMenuState } from "./baseWhichKeyMenu"; export interface RepeaterMenuItem extends BaseWhichKeyMenuItem { @@ -40,8 +40,8 @@ class RepeaterMenu extends BaseWhichKeyMenu { 0 ); return items.map(i => ({ - label: pipe(toSpecializedKey, toFullWidthKey)(i.key) + toFullWidthKey(' '.repeat(max - i.key.length) + '\t'), - description: i.name, + label: toFullWidthSpecializedKey(i.key) + toFullWidthKey(' '.repeat(max - i.key.length)), + description: `\t${i.name}`, detail: i.basePathNames.join('$(chevron-right)'), item: i })); diff --git a/src/menu/transientMenu.ts b/src/menu/transientMenu.ts index 8fb32c2..e0e11cf 100644 --- a/src/menu/transientMenu.ts +++ b/src/menu/transientMenu.ts @@ -4,7 +4,7 @@ import { DisplayOption, toCommands, TransientBindingItem } from "../config/bindi import { MaybeConfig, resolveMaybeConfig, TransientMenuConfig } from "../config/menuConfig"; import { Configs, ContextKey } from "../constants"; import { StatusBar } from "../statusBar"; -import { executeCommands, getConfig, pipe, setContext, toFullWidthKey, toFullWidthSpecializedKey, toSpecializedKey } from "../utils"; +import { executeCommands, getConfig, pipe, setContext, toFullWidthKey, toSpecializedKey } from "../utils"; import { BaseWhichKeyMenu, BaseWhichKeyQuickPickItem, OptionalBaseWhichKeyMenuState } from "./baseWhichKeyMenu"; type OptionalTransientMenuState = OptionalBaseWhichKeyMenuState; @@ -36,7 +36,7 @@ class TransientMenu extends BaseWhichKeyMenu { protected override async handleMismatch(key: string): Promise { - const msg = `${toFullWidthSpecializedKey(key)} is undefined`; + const msg = `${toSpecializedKey(key)} is undefined`; this._statusBar.setErrorMessage(msg); return undefined; }