mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
#10560 changed the script editor's change handler to read `e.detail` instead of `editorCode`, on the reasoning that the two only diverge while the editor is being torn down. They also diverge in a live editor: `setCode` dispatches the string it was handed, but `alignCodeWithEditor` applies that string to Monaco first, and the resulting `onDidChangeModelContent` runs `updateCode` re-entrantly — so if the model normalized the text (EOL is the reachable case; `ScriptBuilder` builds template content with a `\r\n` join), `editorCode` already holds the buffer's version and the payload is the pre-normalization one. Taking the payload leaves `code` disagreeing with what the editor shows, which the external-write effect then tries to reconcile on every change. The language-switch fix in that PR is `alignCodeWithEditor` clearing the timer its own write armed; that part stands and is unaffected. This restores the handler to the buffer-true read. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Windmill frontend
The Windmill frontend written in Svelte 5 + Tailwind CSS
The frontend is under AGPL, see the LICENSE file at the root of this repo