chore(code): reintroduce line wrapping

This commit is contained in:
Elian Doran
2025-05-11 12:07:54 +03:00
parent 9867cd83c4
commit 2628132350
2 changed files with 7 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ type ContentChangedListener = () => void;
export interface EditorConfig extends EditorViewConfig {
placeholder?: string;
lineWrapping?: boolean;
onContentChanged?: ContentChangedListener;
}
@@ -37,6 +38,10 @@ export default class CodeMirror extends EditorView {
extensions.push(placeholder(config.placeholder));
}
if (config.lineWrapping) {
extensions.push(EditorView.lineWrapping);
}
if (config.onContentChanged) {
extensions.push(EditorView.updateListener.of((v) => this.#onDocumentUpdated(v)));
}