bec34f2d57
* added alt+/ as the shortcut key for nerd stats Signed-off-by: gurkiran_singh <gurkiransinghk@gmail.com> * added shortcut info in HelpDialog.ts Signed-off-by: gurkiran_singh <gurkiransinghk@gmail.com> * resolved conflicts Signed-off-by: gurkiran_singh <gurkiransinghk@gmail.com> * added shortcut info in HelpDialog.ts Signed-off-by: gurkiran_singh <gurkiransinghk@gmail.com>
20 lines
502 B
TypeScript
20 lines
502 B
TypeScript
import { register } from "./register";
|
|
import { CODES, KEYS } from "../keys";
|
|
|
|
export const actionToggleStats = register({
|
|
name: "stats",
|
|
perform(elements, appState) {
|
|
return {
|
|
appState: {
|
|
...appState,
|
|
showStats: !this.checked!(appState),
|
|
},
|
|
commitToHistory: false,
|
|
};
|
|
},
|
|
checked: (appState) => appState.showStats,
|
|
contextItemLabel: "stats.title",
|
|
keyTest: (event) =>
|
|
!event[KEYS.CTRL_OR_CMD] && event.altKey && event.code === CODES.SLASH,
|
|
});
|