alohaeditor/Aloha-Editor — pull request #768 by izak (2012-10-16 11:07:55+00:00)
Title: Fix for broken undo plugin

The undo plugin would only allow one level of undo, whatever was undone became a new edit, so the effect was that undoing again would perform a redo. This happened because the snapshot (which was made optional) grew stale, which means there is always a difference between the snapshot and the current editable, causing patches to be pushed to the stack when there should have been no changes.

In addition, I refactored the plugin somewhat so one could wrap it in another plugin. I've written a plugin (not included here) that provides icons on the toolbar for undo and redo. It wraps the undo plugin, but in order to use the functionality, undo/redo had to become class-level members.