This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

UndoManagerNG

The current undo manager has served us well for a long time, but it's starting to show its age.

Current situation

The Good:

The Bad (also know as Design Issues)

The Ugly (also known as Implementation Issues)

Update: this part has been fixed with the new implementation based on GQueues.

Proposed changes

What follows is a series of ideas to address the aforementioned issues. Some of the ideas may be good, some may be crack. Also note that while coming up with super generic UndoManager design that addresses all the issues would be nice, it's not required: we can get away with something that's just better of what we have now, especially as long as it stays private to gtksourceview.

object split

Currently we have an undomanager object that gets attached to the buffer. This is rather nice and allows to attach the undo manager to other objects without too much hassle. However it poses certain problems:

extensibility

Currently we can only handle insert and delete. We need a way to at least handle 'apply tag'. There are other actions that while being an insertion or deletion would be nice to be able to distinguish, e.g. paste, search and replace.

Each action could have a pointer to an ActionClass that would be an object containing a vtable specifying how that kind of action can be undone/redone/merged with the current top of the stack.

Further enhancements

There are also other enhancements that would be nice to have.


2024-10-23 11:37