05Aug04 - I have implemented undo functionality in tkoutline. It is in it's early stages, but it is usable. I have placed a development version containing this functionality at http://tkoutline.sourceforge.net/tkoutline-devel.kit.
Current features:
- Infinite undo/redo up to the last time the outline was saved
- The undo itself is implemented at the tree level, but the operations are grouped together so if a single user operation results in several tree modifications, they will all be grouped into a single undo.
- Since undo is implemented at the tree level, any user scripts (i.e. see scripting tkoutline) will automatically have their operations undoable.
Here are some quirks in the current implementation:
- Behavior of the cursor isn't what I would expect on some undo operations.
- Undoing delete or cut of entire subtrees is slow (so slow that the reconstruction of each node can be seen one at a time).
- The expand/collapse state is not preserved when undoing a cut or delete of a subtree.
- The undo/redo menu picks don't grey out when there is nothing on the undo or redo stack.
- Every typed character causes the entire text of a given node to be saved onto the undo stack, so typing in a really long node can cause the undo stack to get huge rather quickly.
01/09/2004 Iain Cheyne I downloaded the kit and file to activate it, but could not get it working in the time available. I want to test the next release, so please make a post to news:alt.comp.freeware to let us know. :o)
I posted a win32 exe version at http://tkoutline.sourceforge.net/tkoutline-devel.exe, if that helps.
02/09/2004 Iain Cheyne Sadly not, there is an error message when I open it.
Error in startup script
wrong # args: should be "source fileName"
while executing
"source C:/Documents and Settings/Iain/Desktop/tkoutline.exe/lib/tkoutline/outlinefile.tcl"
(in namespace eval "::" script line 2) invoked from within
"namespace eval namespace parent [bad-link: subst {</p><pre> source [file join $scriptdir outlinefile.tcl]subst { source [file join $scriptdir outlinefile.tcl source [bad-link: file join $scriptdir outlinedocument...." (procedure "tkoutline::main" line 8) invoked from within</pre><p>"tkoutline::main $argv"</p><pre> (file "C:/Documents and Settings/Iain/Desktop/tkoutline.exe/main.tcl" line 4)</pre><hr size=1><p>OK</p><hr size=1><p>[Brian Theado]file join $scriptdir outlinedocument...." (procedure "tkoutline::main" line 8) invoked from within"tkoutline::main $argv" (file "C:/Documents and Settings/Iain/Desktop/tkoutline.exe/main.tcl" line 4)OK[Brian Theado - thanks alot for this report. I have fixed this bug. You can either re-download, or as a workaround for what you already downloaded, just move the .exe file to a directory that doesn't contain spaces anywhere in the path (i.e. move it to the root c:\ directory). It worked fine in a directory without spaces in the path and gives the above error in a directory with spaces in the path.
Iain Cheyne - Thanks for responding so fast. I have had a quick play and it works fine. Obviously more undo steps would be a bonus, but one step is a big improvement in usability.
Brian Theado - What do you mean by undo steps? Do you mean how many previous operations that can be undone or do you mean how fine-grained the undo is? There is no limit on how many operations can be undone. The only limit is that you can't undo past a save. That limit is arbitrary and one I placed in there because I thought there should be come sort of limit. I might have to survey some other editors and see what scheme they use. If this isn't the behavior you see, then please let me know.
Iain Cheyne - Once again, you are right and I am wrong. I am not sure why I only saw one undo level, I must have done it too quickly. Anyway, it works perfectly for my needs. Thanks.