Ah. So that's what the todo is about. I'd agree that getTextNodeAtStep is a better solution than this in that case :). This will have unintended side effects if the cursor is nowhere near the requested insert text location.