public TextRange getNonEmptyTextRange() {
    int endOffset = formattingRange.getStartOffset() == formattingRange.getEndOffset()
                 ? formattingRange.getEndOffset() + 1
                 : formattingRange.getEndOffset();
    
    return new TextRange(formattingRange.getStartOffset(), endOffset);
  }
public TextRange getNonEmptyTextRange()