void (int startOffset, int endOffset) { if (checkDirty()) return; int startVisualLine = myView.offsetToVisualLine(startOffset, false); int endVisualLine = myView.offsetToVisualLine(endOffset, true); int lineDiff = myEditor.getVisibleLineCount() - myLineWidths.size(); invalidateWidth(lineDiff == 0 && startVisualLine == endVisualLine, startVisualLine); if (lineDiff > 0) { int[] newEntries = new int[lineDiff]; myLineWidths.addAll(startVisualLine, IntArrayList.wrap(newEntries)); } else if (lineDiff < 0) { myLineWidths.removeElements(startVisualLine, startVisualLine - lineDiff); } for (int i = startVisualLine; i <= endVisualLine && i < myLineWidths.size(); i++) { myLineWidths.set(i, UNKNOWN_WIDTH); } }