private long getLineCount(final TextRange highlight) {
        int lineNoFrom = highlight.getFrom().getLineNo();
        if (lineNoFrom == 1) {
            return highlight.getTo().getLineNo() - highlight.getFrom().getLineNo() + 1;
        } else {
            return highlight.getTo().getLineNo() - highlight.getFrom().getLineNo();
        }
    }
The ranges returned are line/col positions in the input text. Thus the input text should
not be changed/formatted after the highlight ranges have been generated.
stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java