newLISP Fan Club

Forum => newLISP in the real world => Topic started by: dave_f on December 17, 2007, 03:28:04 PM

Title: problems Undo-ing find-and-replace
Post by: dave_f on December 17, 2007, 03:28:04 PM
I noticed that if I use Edit:Find to replace a target string with a substitute string, hitting Edit:Undo deletes the substitute string, but does not restore the original target string.  For that, you need to hit Undo a second time.  This is only a minor annoyance, but it does seem like one click too many.  



More troublesome - if I use the Replace All button in the Find window to replace multiple instances of a target string, then Undo is either grayed out or doesn't seem to do anything.  



thank you,



dave_f

Mac OS 10.4.11   Intel iMac

newLISP v.9.2.10
Title:
Post by: Lutz on December 18, 2007, 07:36:46 AM
thanks for the report, will look into it



Lutz
Title:
Post by: Lutz on December 21, 2007, 11:03:54 AM
in 9.2.11 find-replace-all in newlisp-edit.lsp now accepts undo, but still undo must be executed double, like with simple find-replace. Any suggestion how to fix this is welcome (needs in depth knowledge of the Java UndoManager object/interface)



Paste and set-text operations in Java are split into a delete and add operation and need an undo for each currently.



In undo of replace-all this produces a scary moment, after the first undo the whole editor contents disappears, then a second undo brings the text back, as it existed before replace-all.



Lutz
Title:
Post by: Lutz on December 21, 2007, 03:33:25 PM
... looks like the double undo could be eliminated :-)



Lutz