Hey, guys! I'm making my very first extension, It's quite simple, it adds "spoiler" button to composer. The button inserts [details] bbcode like this
app.composer.editor.insertAtCursor('[details][/details]');
After that I need to move cursor between the open and close tags so a user will be able to print right away without need to move cursor manually. But I can't figure out how to move the cursor there since I don't know exact position and length of the text before or after the bbcode (the user can add it not only to the end of the text, but to any place).
I will be grateful for any advice 🙂