Cannot be done: Undo after save

Wishlists for new functionality and features.
Post Reply
valkyr
Posts: 1
Joined: 06 Mar 2010 04:32

Cannot be done: Undo after save

Post by valkyr »

It'd be nice if undo still worked after saving a file...
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Re: Undo after save

Post by Maël »

The big-file support means undo after save cannot be implemented without copying the entire file, which would be slow.
DVV
Posts: 14
Joined: 17 Jan 2008 11:24

Re: Undo after save

Post by DVV »

Maël wrote:The big-file support means undo after save cannot be implemented without copying the entire file, which would be slow.
Just my thoughts. With planned internal script support, both modification and undo operations could be done by the same script engine:
1. modification -> (script) log <addr1>, <original_value1>; mov <addr1>, <new_value1>; log <addr2>, <original_value2>; mov <addr2>, <new_value2>; ...
2. undo -> (script) mov <addr1>, <original_value1>; mov <addr2>, <original_value2>; ...
The logging (i.e. remembering of the previous values) could be done by the script engine internally.
Such approach assumes all the user operations are first transformed to the internal script commands which are executed then. Of course, this may need architecture re-design of HxD.
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Re: Undo after save

Post by Maël »

HxD already keeps a diff of what was added, inserted and deleted in a file. But this diff is only valid as long as the underlying file doesn't change in an unknown way (i.e. is changed by an external program). As soon as a file is saved it's unlocked thereby making it possible for other programs to change it. So undo after save isn't possible, except if you make a temporary copy of the file (which is costly when the file is big).
Post Reply