After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 529322 - [Patch] Include anchors during undo
[Patch] Include anchors during undo
Status: RESOLVED NOTABUG
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-22 04:54 UTC by Sadrul Habib Chowdhury
Modified: 2008-04-22 12:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (6.06 KB, patch)
2008-04-22 04:55 UTC, Sadrul Habib Chowdhury
none Details | Review

Description Sadrul Habib Chowdhury 2008-04-22 04:54:55 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.
Comment 1 Sadrul Habib Chowdhury 2008-04-22 04:55:29 UTC
Created attachment 109669 [details] [review]
Patch
Comment 2 Sadrul Habib Chowdhury 2008-04-22 05:00:27 UTC
Any hint at fixing redo-with-anchors would be greatly appreciated too! :)
Comment 3 Yevgen Muntyan 2008-04-22 12:32:33 UTC
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).
Comment 4 Yevgen Muntyan 2008-04-22 12:40:56 UTC
Sorry, it does make sense, you just need to disable redo - would be better than nothing. Closing the bug anyway.