feat(commandline): adds toggling for keymaps legend on cli

This commit is contained in:
seaerchin 2021-04-08 03:22:44 +08:00
parent 30ca2a8a62
commit 33429969d5

View file

@ -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...",