I’m trying to implement a block widget that is derived from a special token in the editor’s text. I have been able to get this to work successfully with a state field, but newlines are inserted before the block widget any time I edit the line. Here’s an example.
If you edit either line that contains the text “SPECIAL_TOKEN”, you will see what I mean. Oddly enough, it doesn’t appear to happen on delete, just on insert.