public CompoundUndoManager(SyntaxDocument doc) { this.doc = doc; doc.addUndoableEditListener(this); lastLine = doc.getStartPosition().getOffset(); }