Insert text at the cursor, as follows
editor.current.view.dispatch({
changes: {
from: range.from,
to: range.to,
insert: text
}
})
but,I want to insert text at the cursor and place the cursor in the middle of the inserted text,I know the old version
editor.replaceSelection(`**${selection}**`);
const cursor = editor.getCursor();
cursor.ch -= 2;
editor.setCursor(cursor);
I don’t know how to do it in the new version