private int tryGetConvenientOffsetForCaret() {
    Rectangle visibleArea = editor.getScrollingModel().getVisibleAreaOnScrollingFinished();
    return editor.logicalPositionToOffset(editor.xyToLogicalPosition(new Point(
      0, visibleArea.y + editor.getLineHeight())));
  }
private int tryGetConvenientOffsetForCaret()