refactor: using usual function syntax

Im not exactly sure what was the point in reassigning the show function
This commit is contained in:
Miodec 2023-08-13 15:37:33 +02:00
parent 174525c6be
commit a752a1a8cd

View file

@ -223,7 +223,7 @@ function updateSuggested(): void {
updateActiveEntry();
}
let show = (): void => {
function show(): void {
themeChosen = false;
activeIndex = 0;
commandLineMouseMode = false;
@ -254,7 +254,7 @@ let show = (): void => {
$("#commandLine input").val("");
updateSuggested();
$("#commandLine input").trigger("focus");
};
}
function hide(shouldFocusTestUI = true): void {
UpdateConfig.previewFontFamily(Config.fontFamily);
@ -413,14 +413,9 @@ function generateSingleListOfCommands(): {
list: MonkeyTypes.Command[];
} {
const allCommands: MonkeyTypes.Command[] = [];
const oldShowCommandLine = show;
show = (): void => {
//
};
CommandlineLists.commands.list.forEach((c) =>
addChildCommands(allCommands, c)
);
show = oldShowCommandLine;
return {
title: "All Commands",
list: allCommands,