Codemirror 6: Up and down arrow with line wrapping

I’ve noticed that using the up and down arrows while the line is wrapped takes the cursor to a completely different line rather than the wrapped portion of the line. Is this configurable or is the best course to override the Up and Down arrow commands in order to move onto the wrapped portion?

That would be a bug. I’ll look into it sometime later.

1 Like

I can’t reproduce this. Are you using EditorView.lineWrapping to enable the wrapping? Can you share the minimal setup that displays the problem?

The docs here led me to believe that the editor infers lineWrapping from the CSS styling of its element:

readonly lineWrapping: boolean
Whether this editor wraps lines (as determined by the white-space CSS property of its content element).

but now I see that there is additionally a lineWrapping extension defined on EditorView. Now that I’ve enabled it, line-wrapping behaves as expected.

The docs here led me to believe that the editor infers lineWrapping from the CSS styling of its element:

That should also work. Which element were you styling, and how?