Closed alexandrsek closed 2 years ago
I do not understand what you mean. @alexandrsek
I think I am looking for a solution to the same problem.
The EditorView object allow a lineWrapping
argument: https://codemirror.net/docs/ref/#view.EditorView.lineWrapping
How is it possible to set this parameter (and others similar options) to true
?
@yannicka See example: https://codemirror.net/examples/config/#dynamic-configuration
import React from "react";
import { EditorView } from "codemirror";
import CodeMirror from "@uiw/react-codemirror";
import { javascript } from "@codemirror/lang-javascript";
export default function App() {
return (
<div>
<CodeMirror
value="console.log('hello world!');console.log('hello world!');console.log('hello world!');console.log('hello world!');"
height="200px"
theme="dark"
extensions={[EditorView.lineWrapping, javascript({ jsx: true })]}
onChange={(value, viewUpdate) => {
console.log("value:", value);
}}
/>
</div>
);
}
@yannicka @alexandrsek
https://discuss.codemirror.net/t/dynamically-change-linewrapping/3027/3
Thanks! Thats exactly what I was looking for! Good luck!
Hello everyone! How to apply the line-break?