void (@NotNull Inlay<?> inlay) { if (myEditor.getDocument().isInBulkUpdate() || myEditor.getInlayModel().isInBatchMode()) return; Inlay.Placement placement = inlay.getPlacement(); if (myEditor.getDocument().isInEventsHandling()) { if (placement == Inlay.Placement.AFTER_LINE_END) myVisualPositionUpdateScheduled = true; return; } if (placement == Inlay.Placement.INLINE) { doWithCaretMerging(() -> { for (CaretImpl caret : myCarets) { caret.onInlayRemoved(inlay.getOffset(), ((InlineInlayImpl<?>)inlay).getOrder()); } }); } else if (placement != Inlay.Placement.AFTER_LINE_END || hasCaretInVirtualSpace()) { updateVisualPosition(); } }