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.

I’ve finally tried this. Yes, there’s a side effect - it breaks the gutter.

In each line that has this right-floated block widget the gutter line marker element gains a margin-top equal to the height of the widget. So all the gutter line markers are shifted.

<div class="cm-gutterElement" style="height: 18.2px; margin-top: 16px;">

Is there any workaround to that? Thanks!

Here’s a screenshot of the behaviour (I added the widget to each line):

Not sure if it’s a proper solution, but setting height: 0; on the widget helped me achieve this. The widget is still visible.