I found how to use widget by this example zebra example,
but there it recommend put it like extension, and I don’t find way to make line readonly and update widget on trigger. For example: after sending request I want to show error line.
Also tried another way to insert empty line with dispatch.
But line is also available to changes, line without background styles, and after dispatch there appearing a number on a new line.
It looks like you’re looking for block widgets, which are widget decorations with a block: true option, which causes them to appear between the lines, rather than inside of them.
So, I found solution for realize Inline block Widget in CodeMirror6 like in CodeMirror5.
Initiated widget with { block: true }, like extension with Compartment. In default widget is hide.
2.In html I have button. onClick I make editorView.dispatch({ effects: compartmentVariable.reconfigure(showWidgetState) })
It works. Will prepare codesandbox.
But solution looks ugly. When writing extension I have to provide
StateField.define<DecorationSet>({
create(){}
update(currentDecorations, transaction){
/**
And here is ugly peace.
Because I have to write handle on codemirror update and
check where updates, in which line and how to combine
changes with widget. Maybe I can simulate Codemirror5
block widget by easier solution?
*/
}
provide(){}
})