Pretext line wrapping

After the public state of pretext, i want to create a self implementation for the line wrap but, i have encounter the problem, that when i add the <br> tag to break the words it bugs the selection, is there some way to tell the editor to think the browser is doing the line wrapping but do it by hand instead.

Are you setting the lineBreaks property on your widgets? See this example.

Yes, but if i send those in a viewPlugin it bugs again.

this is a small example: Try CodeMirror

Right. You can’t do that. Decorations that affect line structure must not go through the view (because the view needs to be able to compute its viewport and structure before it accesses view-dependent decorations).

But if i use a StateField.define how can i detect the width change of the editor? to rerender the decorations, because it does not trigger a transaction.

You’ll have to move to a model where a plugin, post-update, checks whether the line breaks are in the right place, and if not, dispatches a new transaction to move them.

Thanks for the help marijn!.