I tried using tr.setSelection(new TextSelection($start, $end)) and while it’s setting the selection in the editor, the actual highlighted text isn’t changing.
Is it possible to programmatically replace the selected text / node? Or will I have to use decorations or some other trick to highlight the text?
Possibly (though this is well-exercised code, in general, and there’d have to be some corner case involved). Can you isolate it in a simple, vanilla editor setup?
Implementation details changed a bit, but still will likely need this functionality at some point. So I’ll make sure to open up an issue later if problem persists.