CharSequence (@NotNull CharSequence buffer, int startOffset, int endOffset) { StringBuilder result = new StringBuilder(); int offset = startOffset; for (DeletedIndentInfo deletion : myDeletions) { result.append(buffer.subSequence(offset, deletion.getRealPos())); deletion.setShrunkPos(result.length()); offset = deletion.getRealPos() + deletion.getLength(); } result.append(buffer.subSequence(offset, endOffset)); return result.toString(); }