Skip to content

Commit

Permalink
Ensure consistency of use of full width characters
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenguh committed Nov 25, 2021
1 parent cdee8ca commit 0453e63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/menu/repeaterMenu.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -40,8 +40,8 @@ class RepeaterMenu extends BaseWhichKeyMenu<RepeaterMenuItem> {
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
}));
Expand Down
4 changes: 2 additions & 2 deletions src/menu/transientMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransientBindingItem>;
Expand Down Expand Up @@ -36,7 +36,7 @@ class TransientMenu extends BaseWhichKeyMenu<TransientBindingItem> {

protected override async handleMismatch(key: string):
Promise<OptionalTransientMenuState> {
const msg = `${toFullWidthSpecializedKey(key)} is undefined`;
const msg = `${toSpecializedKey(key)} is undefined`;
this._statusBar.setErrorMessage(msg);
return undefined;
}
Expand Down

0 comments on commit 0453e63

Please sign in to comment.