I would like to setCursor to the location that is returned by findText.
Here is what I am trying:
var position = doc.newPosition(foundElement.getElement(), foundElement.getStartOffset());
doc.setCursor(position);
But, the cursor does not move. Even with the simple examples like
//setting cursor at the beginning of the doc
var paragraph = doc.getBody().getChild(0);
var position = doc.newPosition(paragraph.getChild(0), 0);
doc.setCursor(position);
findText returns a rangelement, while document.setCursor expects a position. How do I go from rangeelement to position? :)
This got me halfway to the solution Finding text (multiple times) and highlighting