mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-18 02:13:03 -04:00
add checkbox in settings to enable line wrapping
This commit is contained in:
@@ -88,13 +88,7 @@ const highlightField = StateField.define({
|
||||
provide: (f) => EditorView.decorations.from(f),
|
||||
});
|
||||
|
||||
const staticExtensions = [
|
||||
javascript(),
|
||||
highlightField,
|
||||
flashField,
|
||||
javascriptLanguage.data.of({ autocomplete: strudelAutocomplete }),
|
||||
EditorView.lineWrapping,
|
||||
];
|
||||
const staticExtensions = [javascript(), highlightField, flashField];
|
||||
|
||||
export default function CodeMirror({
|
||||
value,
|
||||
@@ -105,6 +99,7 @@ export default function CodeMirror({
|
||||
keybindings,
|
||||
isLineNumbersDisplayed,
|
||||
isAutoCompletionEnabled,
|
||||
isLineWrappingEnabled,
|
||||
fontSize = 18,
|
||||
fontFamily = 'monospace',
|
||||
options,
|
||||
@@ -150,8 +145,12 @@ export default function CodeMirror({
|
||||
_extensions.push(autocompletion({ override: [] }));
|
||||
}
|
||||
|
||||
if (isLineWrappingEnabled) {
|
||||
_extensions.push(EditorView.lineWrapping);
|
||||
}
|
||||
|
||||
return _extensions;
|
||||
}, [keybindings, isAutoCompletionEnabled]);
|
||||
}, [keybindings, isAutoCompletionEnabled, isLineWrappingEnabled]);
|
||||
|
||||
return (
|
||||
<div style={{ fontSize, fontFamily }} className="w-full">
|
||||
|
||||
Reference in New Issue
Block a user