react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

Is there a way to auto wrap when the text is reaching the maxWidth?

Open EmbedConner opened this issue 2 years ago • 3 comments

Is there a way to auto wrap when the text is reaching the maxWidth?

EmbedConner avatar May 17 '22 11:05 EmbedConner

You need to seek answers here: https://codemirror.net/6/ @EmbedConner

jaywcjlove avatar May 17 '22 11:05 jaywcjlove

@EmbedConner you need to install @codemirror/view and add it as extension.

import { EditorView } from "@codemirror/view";

function MyComponent() {
  return (
    <CodeMirror value={"Code here"} extensions={[EditorView.lineWrapping]} />
  );
}

raulfdm avatar Jun 28 '22 09:06 raulfdm

Thank you very much!

piotrgregor avatar Jun 30 '23 10:06 piotrgregor