Prev Up Next
Properties Developer's Guide Plugins

The Undo Mechanism

Sketch allows the user to undo every operation that is performed on a document. To achieve this, it needs to keep some information on how to undo the operation. The fact that in Python objects are dynamically typed and functions and (bound) methods are objects allows us to store this information in a very simple and yet very flexible way.

I'll call this information undo information, or undoinfo for short.

Creation and Storage

Representation of Undoinfo

Combining Undoinfo

The Undo API


Properties Developer's Guide Plugins
Prev Up Next