GNOME Bugzilla – Bug 326622
Undo manager rewriting
Last modified: 2009-12-29 15:19:35 UTC
Undo manager needs rewriting since current architecture is not extendible and has many limitations. We will use this back to track such activity and to gather informations about existing code in other projects. Tomboy: http://cvs.gnome.org/viewcvs/*checkout*/tomboy/Tomboy/Undo.cs Moo: http://svn.berlios.de/viewcvs/ggap/moo/trunk/moo/mooutils/mooundomanager.h http://svn.berlios.de/viewcvs/ggap/moo/trunk/moo/mooutils/mooundomanager.c http://svn.berlios.de/viewcvs/ggap/moo/trunk/moo/mooedit/mootextbuffer.c?rev=917&r1=901&r2=917 Bluefish: http://cvs.sourceforge.net/viewcvs.py/bluefish/bluefish-gtk2/src/undo_redo.h?view=markup http://cvs.sourceforge.net/viewcvs.py/bluefish/bluefish-gtk2/src/undo_redo.c?view=markup
Just so it doesn't get missed: the new highlighting engine introduces new signals for buffer inserts & deletes. The undomanager should listen for these signals instead of the GtkTextBuffer signals since the code folding integration behavior is that sometimes a delete/insert doesn't actually result in characters being deleted/inserted, just the fold expanding. (when the cursor is in a part of a collapsed fold, don't insert/delete a character there, just expand the fold).
(In reply to comment #1) > Just so it doesn't get missed: the new highlighting engine introduces new > signals for buffer inserts & deletes. Those signals have gone.
(In reply to comment #1) > the code folding integration > behavior is that sometimes a delete/insert doesn't actually result in > characters being deleted/inserted, just the fold expanding. (when the cursor is > in a part of a collapsed fold, don't insert/delete a character there, just > expand the fold). What do you mean here, by the way? insert-text and delete-range may not be stopped by folding. Backspace pressed may or may not delete a character, but the delete-range signal doesn't carry any information about what happened, it may or may not be interactive.
What i mean is this: when the cursor is inside a folded block of text, pressing backspace, or delete doesn't actually delete anything. It just expands the fold. Example: /** this is a multiline b|lock folded... */ /** this is a multiline b|lock folded... * which is now expanded. */ | is where the cursor is.
(In reply to comment #4) > What i mean is this: when the cursor is inside a folded block of text, pressing > backspace, or delete doesn't actually delete anything. It just expands the > fold. Example: > > > /** this is a multiline b|lock folded... */ > > /** this is a multiline b|lock folded... > * which is now expanded. */ > > | is where the cursor is. > I understood this. But, do you actually stop delete-range emission (if yes, it's a bug)?
I forget how i've implemented it exactly on the folding branch. If you know how to do it properly and it's possible with the new code, then it's fine by me.
No point keeping this generic bug open... beside there are generic "undo framework" bugs in gtk and ideally an improved undo manager belongs there.