private int getOffset(int visualLine, boolean startLine) {
    return myEditor.visualPositionToOffset(new VisualPosition(visualLine, startLine ? 0 : Integer.MAX_VALUE));
  }
private int getOffset(int visualLine, boolean startLine)