@Override
          public void paintAfterLineEnd(IterationState it, int columnStart, float x, int y) {
            if (dryRun) return;
            TextAttributes backgroundAttributes = it.getPastLineEndBackgroundAttributes().clone();
            CustomFoldRegion cfr = visLinesIterator.getCustomFoldRegion();
            if (cfr != null) {
              paintBackground(backgroundAttributes, startX, y, endX - startX, cfr.getHeightInPixels());
              myTextDrawingTasks.add(g -> {
                cfr.getRenderer().paint(cfr, g, new Rectangle2D.Double(x, y, cfr.getWidthInPixels(), cfr.getHeightInPixels()),
                                        backgroundAttributes);
              });
              return;
            }
            paintBackground(backgroundAttributes, x, y, endX - x);
            int offset = it.getEndOffset();
            SoftWrap softWrap = myEditor.getSoftWrapModel().getSoftWrap(offset);
            if (softWrap == null) {
              int logicalLine = myDocument.getLineNumber(offset);
              List<Inlay<?>> inlays = myEditor.getInlayModel().getAfterLineEndElementsForLogicalLine(logicalLine);
              float extensionsStartX = inlays.isEmpty()
                                       ? x
                                       : x + myView.getPlainSpaceWidth() + inlays.stream().mapToInt(Inlay::getWidthInPixels).sum();
              collectExtensions(visualLine, offset);
              paintLineExtensionsBackground(visualLine, extensionsStartX, y);
              paintVirtualSelectionIfNecessary(visualLine, columnStart, x, y);
              myTextDrawingTasks.add(g -> {
                if (!inlays.isEmpty()) {
                  float curX = x + myView.getPlainSpaceWidth();
                  for (Inlay inlay : inlays) {
                    int width = inlay.getWidthInPixels();
                    inlay.getRenderer().paint(inlay, g, new Rectangle2D.Double(curX, y, width, myLineHeight), backgroundAttributes);
                    curX += width;
                  }
                }
                paintLineExtensions(visualLine, logicalLine, extensionsStartX, y + myAscent);
              });
            }
            else {
              paintSelectionOnFirstSoftWrapLineIfNecessary(visualLine, columnStart, x, y, primarySelectionStart, primarySelectionEnd);
              if (paintSoftWraps) {
                myTextDrawingTasks.add(g -> {
                  myEditor.getSoftWrapModel().doPaint(g, SoftWrapDrawingType.BEFORE_SOFT_WRAP_LINE_FEED, (int)x, y, myLineHeight);
                });
              }
            }
          }
@Override
          public void paintAfterLineEnd(IterationState it, int columnStart, float x, int y)