void () { if (myDocument.isInBulkUpdate() || myEditor.getInlayModel().isInBatchMode() || myDirty) return; for (int visualLine = 0; visualLine < myLineWidths.size(); visualLine++) { int cachedWidth = myLineWidths.getInt(visualLine); if (cachedWidth < 0 || cachedWidth == UNKNOWN_WIDTH) continue; Ref<Boolean> quickEvaluation = new Ref<>(); int actualWidth = calculateLineWidth(new VisualLinesIterator(myEditor, visualLine), () -> quickEvaluation.set(Boolean.TRUE)); assert !quickEvaluation.isNull() || actualWidth == cachedWidth : "Wrong cached width for visual line " + visualLine + ", cached: " + cachedWidth + ", actual: " + actualWidth; } }