From de77f909e0d332b165b00998a227648c38b2896f Mon Sep 17 00:00:00 2001 From: Nils Kruthoff Date: Mon, 13 Jul 2026 11:47:38 +0200 Subject: [PATCH] disable codejars soft-wrap to keep aligned with the new-line gutter --- app/MindWork AI Studio/Components/CodeEditor.razor.cs | 2 +- .../wwwroot/system/CodeEditor/code-editor.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Components/CodeEditor.razor.cs b/app/MindWork AI Studio/Components/CodeEditor.razor.cs index f6fceff0..08de3997 100644 --- a/app/MindWork AI Studio/Components/CodeEditor.razor.cs +++ b/app/MindWork AI Studio/Components/CodeEditor.razor.cs @@ -23,7 +23,7 @@ public partial class CodeEditor : ComponentBase, IAsyncDisposable public string Class { get; set; } = string.Empty; private readonly string editorId = $"code-editor-{Guid.NewGuid():N}"; - private const string CODE_EDITOR_MODULE = "./system/CodeEditor/code-editor.js?v=20260708-1"; + private const string CODE_EDITOR_MODULE = "./system/CodeEditor/code-editor.js?v=20260713-1"; private ElementReference editorElement; private ElementReference lineNumbersElement; private IJSObjectReference? module; diff --git a/app/MindWork AI Studio/wwwroot/system/CodeEditor/code-editor.js b/app/MindWork AI Studio/wwwroot/system/CodeEditor/code-editor.js index cb5397c6..969420ee 100644 --- a/app/MindWork AI Studio/wwwroot/system/CodeEditor/code-editor.js +++ b/app/MindWork AI Studio/wwwroot/system/CodeEditor/code-editor.js @@ -32,6 +32,9 @@ export function init(id, element, lineNumbersElement, code, language) { tab: ' ', spellcheck: false }); + // CodeJar enables soft wrapping by default, which cannot stay aligned with a newline-based gutter. + element.style.whiteSpace = 'pre'; + element.style.overflowWrap = 'normal'; const scrollHandler = () => syncLineNumbersScroll(element, lineNumbersElement); codeJar.updateCode(code ?? '');