mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-13 17:42:10 +00:00
disable codejars soft-wrap to keep aligned with the new-line gutter
This commit is contained in:
parent
32115eafd4
commit
de77f909e0
@ -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;
|
||||
|
||||
@ -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 ?? '');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user