Please also add a TODO that this can be optimized, as usually (well, in interactive editing) the cursor is already at the position and could be automatically moved by inserting to text node right before it, as it has be done before.