You were "pre-creating" the context menu and trying to reuse it with each context menu request but the menu and its actions are created based on the current state of the editor (the actions are not updated), so they didn't reflect any changes (such as selecting text) that happened after you called createStandardContextMenu().
Bookmarks