enthought/traits

Add Command Merging

Closed this issue · 1 comments

Currently if we have fine-grained commands such as an command fired on every keystroke, or as an object is dragged, then the undo/redo will also be fine-grained.

It's common practice to merge similar commands which happen one after (eg. a sequence of keystrokes) into a single one (eg. insert all the characters at once) for the purposes of undo/redo, so that undo/redo does all at once.

One way to do this is via a merge function which is given the new command and has the opportunity to merge it into the previous command. The pyface undo/redo system demonstrates this capability.

Wrong repo 😊