int len = undoEdit.getLength(); int bolRemovalPos = -1; int eolRemovalPos = -1;
endPos = undoEdit.getOffset() + undoEdit.getLength(); // inserted
synchronized void removeEdit(ModifyUndoEdit undoEdit) throws BadLocationException { checkEOLMark(undoEdit.getOffset()); cache.remove(undoEdit.getOffset(), undoEdit.getLength(), null); // no // cache // fragment // optimization // yet removeUpdate(undoEdit); }
/** * This function is called after document removal to update marks. Event * parameter contains removed chars and also how many lines was removed. */ synchronized void removeUpdate(ModifyUndoEdit undoEdit) { docLen -= undoEdit.getLength(); marks.update(undoEdit.getOffset(), undoEdit.getLine(), -undoEdit.getLength(), -undoEdit.getLFCount()); update(true, undoEdit); }
/** * This function is called after document insertion to update marks. Event * parameter contains inserted chars and also how many lines was inserted. */ synchronized void insertUpdate(ModifyUndoEdit undoEdit) { docLen += undoEdit.getLength(); marks.update(undoEdit.getOffset(), 0, undoEdit.getLength(), undoEdit.getLFCount()); update(false, undoEdit); }