synchronized void removeEdit(ModifyUndoEdit undoEdit) throws BadLocationException { checkEOLMark(undoEdit.getOffset()); cache.remove(undoEdit.getOffset(), undoEdit.getLength(), null); // no // cache // fragment // optimization // yet removeUpdate(undoEdit); }
synchronized void insertEdit(ModifyUndoEdit undoEdit) throws BadLocationException { int offset = undoEdit.getOffset(); checkEOLMark(offset); if (undoEdit.isTextValid()) { cache.insertString(offset, undoEdit.getText(), null); } else { // chars buffer valid cache.insert(offset, undoEdit.getChars(), null); } insertUpdate(undoEdit); // always done to update line cache }