Improved undo/redo handler performance by accumulating matching change
to a single one.