mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-06 13:55:19 +08:00
feat(commandline): adds toggling for keymaps legend on cli
This commit is contained in:
parent
30ca2a8a62
commit
33429969d5
1 changed files with 38 additions and 0 deletions
|
@ -15,6 +15,7 @@ import * as Funbox from "./funbox";
|
|||
import * as TagController from "./tag-controller";
|
||||
import * as Commandline from "./commandline";
|
||||
import * as CustomText from "./custom-text";
|
||||
import { keymapLegendStyles } from "../../static/keymap/legend";
|
||||
|
||||
export let current = [];
|
||||
|
||||
|
@ -647,6 +648,33 @@ let commandsKeymapStyle = {
|
|||
],
|
||||
};
|
||||
|
||||
let commandsKeymapLegendStyle = {
|
||||
title: "Change keymap legend style...",
|
||||
list: [
|
||||
{
|
||||
id: "setKeymapLegendStyleLowercase",
|
||||
display: keymapLegendStyles.lowercase,
|
||||
exec: () => {
|
||||
UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.lowercase);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setKeymapLegendStyleUppercase",
|
||||
display: keymapLegendStyles.uppercase,
|
||||
exec: () => {
|
||||
UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.uppercase);
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setKeymapLegendStyleBlank",
|
||||
display: keymapLegendStyles.blank,
|
||||
exec: () => {
|
||||
UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.blank);
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
let commandsHighlightMode = {
|
||||
title: "Change highlight mode...",
|
||||
list: [
|
||||
|
@ -1678,6 +1706,16 @@ export let defaultCommands = {
|
|||
Commandline.show();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "changeKeymapLegendStyle",
|
||||
display: "Change keymap legend style...",
|
||||
alias: "keyboard",
|
||||
subgroup: true,
|
||||
exec: () => {
|
||||
current.push(commandsKeymapLegendStyle);
|
||||
Commandline.show();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "changeKeymapLayout",
|
||||
display: "Change keymap layout...",
|
||||
|
|
Loading…
Reference in a new issue