Widget on right side of line

Hello, I’m trying to achieve something like this (the small “+1 ignored error” div):

So basically a widget that appears at the end of the line. If the text on the same line is too long, it should wrap sooner because of the widget.

Is this possible? None of the decoration types mentioned in the docs (CodeMirror Decoration Example) seem like a good fit for this scenario.

Thank you.

It might be possible to put a block widget that is float: right in there, but it may also be that that causes some unexpected issues.