GNOME Bugzilla – Bug 529322
[Patch] Include anchors during undo
Last modified: 2008-04-22 12:40:56 UTC
Hi. The Undo-manager in gtksourceview is being used in pidgin text entry. Currently, smileys don't behave well when undoing (bug: http://developer.pidgin.im/ticket/5577). I have added a patch that allows undoing the insertion of smileys (patch attached). I am submitting the patch here in the hope that it might be beneficial for other projects. Caveat: Redo doesn't work well. The anchors seem to be inserted, but the smiley icons seem to disappear.
Created attachment 109669 [details] [review] Patch
Any hint at fixing redo-with-anchors would be greatly appreciated too! :)
The patch doesn't make sense as it is, because it doesn't achieve its goal: undo/redo inserting/deleting smileys. You can delete/create child anchors but it's pointless since you also need the child widget. What you can do is to take the undo manager, change existing actions to optionally hold smileys instead of text, and explicitly call its methods as appropriate (and fix up the delete-range handler so you don't process deleting smileys twice).
Sorry, it does make sense, you just need to disable redo - would be better than nothing. Closing the bug anyway.