void (@NotNull Handler handler) { for (FoldedGroup group : myFoldings) { for (FoldedBlock folding : group.blocks) { FoldRegion region1 = folding.getRegion(myLeft); FoldRegion region2 = folding.getRegion(myRight); if (region1 == null || !region1.isValid() || region1.isExpanded()) continue; if (region2 == null || !region2.isValid() || region2.isExpanded()) continue; int line1 = myEditors[myLeft].getDocument().getLineNumber(region1.getStartOffset()); int line2 = myEditors[myRight].getDocument().getLineNumber(region2.getStartOffset()); if (!handler.process(line1, line2, folding.isHovered())) return; break; } } }