void () { mySegmentEndOffset = getCurrentFoldRegionStartOffset(); assert mySegmentEndOffset >= mySegmentStartOffset; if (mySegmentEndOffset > mySegmentStartOffset) { mySegmentEndOffset = Math.min(myNextWrapOffset, Math.min(mySegmentEndOffset, myDocument.getLineEndOffset(myCurrentEndLogicalLine))); boolean normalLineEnd = mySegmentEndOffset < getCurrentFoldRegionStartOffset() && mySegmentEndOffset < myNextWrapOffset; myInlays = myView.getEditor().getInlayModel().getInlineElementsInRange( mySegmentStartOffset, mySegmentEndOffset - (normalLineEnd ? 0 : 1)); // including inlays at line end if (myInlays.isEmpty() || myInlays.get(0).getOffset() > mySegmentStartOffset) { setFragmentIterator(); } } }