@Override
  public int getLineEnd(int line, boolean includeNewline) {
    if (myDocument.getLineCount() == 0) return 0;
    return myDocument.getLineEndOffset(line) + (includeNewline ? myDocument.getLineSeparatorLength(line) : 0);
  }
@Override
  public int getLineEnd(int line, boolean includeNewline)