void (int newEndOffset, FormattingDocumentModel model, CommonCodeStyleSettings.IndentOptions options) { final int oldEndOffset = myEnd; if (newEndOffset == oldEndOffset) return; if (myStart >= newEndOffset) { myRangesAssert.assertInvalidRanges(myStart, newEndOffset, model, "some block intersects with whitespace"); return; } myEnd = newEndOffset; TextRange range = new TextRange(myStart, myEnd); CharSequence oldText = myInitial; myInitial = model.getText(range); if (!coveredByBlock(model)) { myRangesAssert.assertInvalidRanges(myStart, myEnd, model, "nonempty text is not covered by block"); return; } if (newEndOffset > oldEndOffset) { refreshStateOnEndOffsetIncrease(newEndOffset, oldEndOffset, options.TAB_SIZE); } else { refreshStateOnEndOffsetDecrease(oldText, newEndOffset, oldEndOffset, options.TAB_SIZE); } IndentInside indent = IndentInside.getLastLineIndent(myInitial); myInitialLastLinesSpaces = indent.whiteSpaces; myInitialLastLinesTabs = indent.tabs; setFlag(CONTAINS_LF_INITIALLY_MASK, getLineFeeds() > 0); final int totalSpaces = getTotalSpaces(); setFlag(CONTAINS_SPACES_INITIALLY_MASK, totalSpaces > 0); }