Iterator<VisualFragment> getFragmentsInVisualOrder(final @NotNull EditorView view,
                                                     final int line,
                                                     final float startX,
                                                     final int startVisualColumn,
                                                     final int startOffset,
                                                     int endOffset,
                                                     @Nullable Runnable quickEvaluationListener) {
    assert startOffset <= endOffset;
    Document document = view.getEditor().getDocument();
    int lineStartOffset = document.getLineStartOffset(line);
    assert !DocumentUtil.isInsideSurrogatePair(document, lineStartOffset + startOffset);
    assert !DocumentUtil.isInsideSurrogatePair(document, lineStartOffset + endOffset);

    final BidiRun[] runs;
    if (startOffset == endOffset) {
      runs = BidiRun.EMPTY_ARRAY;
    }
    else {
      List<BidiRun> runList = new ArrayList<>();
      for (BidiRun run : getRunsInLogicalOrder()) {
        if (run.endOffset <= startOffset) continue;
        if (run.startOffset >= endOffset) break;
        runList.add(run.subRun(view, line, startOffset, endOffset, quickEvaluationListener));
      }
      runs = runList.toArray(BidiRun.EMPTY_ARRAY);
      if (runs.length > 1) {
        reorderRunsVisually(runs);
      }
    }
    return new VisualOrderIterator(view, line, startX, startVisualColumn, startOffset, runs);
  }
Iterator<VisualFragment> getFragmentsInVisualOrder(final @NotNull EditorView view,
                                                     final int line,
                                                     final float startX,
                                                     final int startVisualColumn,
                                                     final int startOffset,
                                                     int endOffset,
                                                     @Nullable Runnable quickEvaluationListener)