void (DocumentEvent e) { int startLine = offsetToVisualPosition(e.getOffset()).line; int newEndLine = offsetToVisualPosition(e.getOffset() + e.getNewLength()).line; int oldEndLine = myOldEndLine; if (myLineWidths.size() == 0) { reset(); } else { int min = Math.min(oldEndLine, newEndLine); for (int i = startLine; i <= min; i++) myLineWidths.set(i, -1); if (newEndLine > oldEndLine) { int[] delta = new int[newEndLine - oldEndLine]; Arrays.fill(delta, -1); myLineWidths.insert(oldEndLine + 1, delta); } else if (oldEndLine > newEndLine) { myLineWidths.remove(newEndLine + 1, oldEndLine - newEndLine); } myIsDirty = true; } }