Reformatted excerpts from Mike S's message of 2009-04-27: > I'm graduating in a few weeks, so I'll have some free time I can > dedicate to sup again.
Congrats! Great! > I'd like to register Ctrl-R to keep with the vim bindings. Sure. > Ugly method 2: write code in duplicate, register a redo and call redo > This saves duplication of code, but it seems unnecessarily complex. > > * create undo lambda > * create redo lambda > * register undo and redo, but 'queue up' redo > * UndoManager.redo Redo is actually a slightly different operation from do. Do has to ask for user input (what label do you want to apply?), redo just reuses it. Maybe that's not such a big deal though; do/redo can just check to see if it already has the value from the user, and ask if not. > Slightly clever method: have primitives return their own undo/redo. > This can be seen in toggle_starred where actually_toggle_starred > returns its inverse. This shifts the complexity down and keeps higher > level code clean. That sounds eminently reasonable to me. -- William <[email protected]> _______________________________________________ sup-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/sup-talk
