Word wrapping

It seems possible to word wrap the code inside codemirror by changing white-space: pre in white-space: pre-wrap for .cm-content

Is the right way?

Thanks

You can use EditorView.lineWrapping extension.

new EditorView({
    state: EditorState.create({
        extensions: [
            EditorView.lineWrapping
        ]
    })
})
2 Likes