enthought / traits

Observable typed attributes for Python classes
Other
421 stars 85 forks source link

Add Command Merging #1772

Closed corranwebster closed 4 months ago

corranwebster commented 4 months ago

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.

corranwebster commented 4 months ago

Wrong repo 😊