On Mon, 2003-12-08 at 22:44, bulia byak wrote:
Realistically, are users ever going to backtrack through more than ~300 levels of undo anyway?
Easy :) Real drawing sessions may span hours and hours. Right now, however, a crash is a more likely outcome of being in Inkscape for too long, but in the future...
I still have a hard time imagining anyone doing nothing but clicking on 'undo' for several minutes on end, but ok... ^_-
Actually, you know what would be cool? A "snapback" feature for undo like Apple's Safari browser has for its navigation history.
One thing: right now subsequent arrow-key movements are stored as separate undo steps. I'd like to combine all adjacent moves in one direction (only horizontal or only vertical) in one step. Is there already a mechanism for that, or do I have to dig into the undo system to implement it?
Yes, there's already a facility present for that: sp_document_maybe_done().
sp_document_maybe_done(), like sp_document_done(), completes a transaction and pushes the transaction journal onto the undo stack.
All that should be necessary is to replace a couple calls to sp_document_done() in select-context.c.
maybe_done() takes a constant string "key" as a parameter; if it's called multiple times sequentially with the same key, all those actions will be merged into one undo step.
The key doesn't actually mean anything, it just has to identify a particular type of action. I might suggest "keyboard-move-horizontal" and "keyboard-move-vertical".
-mental