void (final @Nullable List<? extends HighlightData> highlightDatas) { if (highlightDatas == null) return; boolean needScroll = true; int minOffset = Integer.MAX_VALUE; for (HighlightData data : highlightDatas) { if (isOffsetVisible(data.getStartOffset())) { needScroll = false; break; } minOffset = Math.min(minOffset, data.getStartOffset()); } if (needScroll && minOffset != Integer.MAX_VALUE) { LogicalPosition pos = myEditor.offsetToLogicalPosition(minOffset); myEditor.getCaretModel().moveToOffset(minOffset); myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); } }