From 9abfb85739f28f19453534c25a80795b1768d6a4 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 23 Dec 2025 16:41:56 +0100 Subject: [PATCH] editor: fix regression in code editor making global variables unrecognized --- src/client/ui/ui-code-editor.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/ui/ui-code-editor.mjs b/src/client/ui/ui-code-editor.mjs index b0f91a5d..8046b637 100644 --- a/src/client/ui/ui-code-editor.mjs +++ b/src/client/ui/ui-code-editor.mjs @@ -207,9 +207,7 @@ class CodeEditor { if (this.language === 'javascript') { let globals = {} - for (var k in scriptGlobals) { - globals[k] = true - } + if (this.name === 'onKeyboard') { globals = {type: true, key: true, code: true, ctrl: true, shift: true, alt: true, meta: true} } else if (this.name === 'onCreate') { @@ -226,6 +224,9 @@ class CodeEditor { globals = {value: true, height: true, width: true, cssVars: true} } + for (var k in scriptGlobals) { + globals[k] = true + } globals.locals = true globals.console = true