mini improvement: while touching this code ```odtDocument.getCursor``` could be only called inside ```(selection.length === 0)``` branch. Ah, and perhaps directly be queried into ```cursorNode```, as that is the only usage of ```cursor``` 2x.