void (@NotNull List<RangeHighlightingData> ranges, @NotNull TextRange range, boolean isBold) { if (!range.isEmpty()) { RangeHighlightingData lastRange = ranges.isEmpty() ? null : ranges.get(ranges.size() - 1); if (lastRange != null && lastRange.isBold == isBold) { lastRange.updateRange(lastRange.textRange.grown(range.getLength())); } else { ranges.add(new RangeHighlightingData(range.getStartOffset(), range.getEndOffset(), isBold)); } } }