setBookmark doesn't update its position

I’ve read many topics about making a real time collaborative editor and I still have some questions about how setBookmark works.
The documentation says that the bookmark follows the text as it is being edited but when I add it, it only stays at the starter position.
Should I update it at every change in the editor?
Is there any example I can follow?
I hope I can get a solution, thank you.

Can you provide a more concrete example of what kind of edits are happening and how you expected the bookmark to behave?

Hi marijin.
I was wondering to add bookmarks to act like cursors for the different clients.
Now I understand how setBookmark works. As I saw in my example, if I type before the bookmark, it will move with the text but is not behaving as a client cursor, because if I use the arrows it stays in the last position.
Maybe I can edit it to update the position when I move the cursor between the letters without texting.

(Sorry about my english)

Well, no, it is definitely not like a cursor. You could remove and re-add the bookmark at the cursor position every time the selection changes, if that’s what you want. Or maybe add styling to the cursor element to get the effect you are looking for.

Thank you! I’m going to try that!

I remove the bookmark with removeChild right?