disable codejars soft-wrap to keep aligned with the new-line gutter

This commit is contained in:
Nils Kruthoff 2026-07-13 11:47:38 +02:00
parent 32115eafd4
commit de77f909e0
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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 ?? '');