int pos = undoEdit.getOffset(); int len = undoEdit.getLength(); int bolRemovalPos = -1;
endPos = undoEdit.getOffset() + undoEdit.getLength(); // inserted
private void update(boolean remove, ModifyUndoEdit undoEdit) { int pos = undoEdit.getOffset(); SyntaxSeg.invalidate(doc, pos); SyntaxSeg.Slot slot = SyntaxSeg.getFreeSlot();
/** * 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); }
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 }