UI: Add "Run" action to run current script in editor (#1987)

This commit is contained in:
catloversg
2025-03-04 17:43:31 +07:00
committed by GitHub
parent 8cdafdc7b9
commit 23ad55554e
7 changed files with 316 additions and 74 deletions
+13 -2
View File
@@ -6,6 +6,7 @@ import { KEY } from "./KeyboardEventKey";
export enum ScriptEditorAction {
Save = "ScriptEditor-Save",
GoToTerminal = "ScriptEditor-GoToTerminal",
Run = "ScriptEditor-Run",
}
export const SpoilerKeyBindingTypes = [
@@ -220,7 +221,7 @@ export const DefaultKeyBindings: Record<KeyBindingType, [KeyCombination | null,
},
null,
],
"ScriptEditor-Save": [
[ScriptEditorAction.Save]: [
{
control: true,
alt: false,
@@ -236,7 +237,7 @@ export const DefaultKeyBindings: Record<KeyBindingType, [KeyCombination | null,
key: "S",
},
],
"ScriptEditor-GoToTerminal": [
[ScriptEditorAction.GoToTerminal]: [
{
control: true,
alt: false,
@@ -252,6 +253,16 @@ export const DefaultKeyBindings: Record<KeyBindingType, [KeyCombination | null,
key: "B",
},
],
[ScriptEditorAction.Run]: [
{
control: true,
alt: false,
shift: false,
meta: false,
key: "Q",
},
null,
],
};
// This is the set of key bindings merged from DefaultKeyBindings and Settings.KeyBindings.