int visualLineToOffset(int visualLine) {
    int start = 0;
    int end = myDocument.getTextLength();
    if (visualLine <= 0) return start;
    if (visualLine >= myView.getEditor().getVisibleLineCount()) return end;
    int current = ObjectUtils.binarySearch(0, myDocument.getTextLength(), mid -> Integer.compare(offsetToVisualLine(mid, false), visualLine));
    if (current < 0) current = -current-1;
    return visualLineStartOffset(current, true);
  }
int visualLineToOffset(int visualLine)