Discussion:
saving key stroke history
Wayne.Lydecker-o70QjBUuf8rQT0dZR+
2011-03-23 19:56:22 UTC
Permalink
Is there a way to save (and restore) key stroke history? Our file servers
were relocated, which forced me to reboot. I frequently use the Ctrl-Z and
Shft-Ctrl-Z for numerous reasons, like to easily restore a file to its
original state (and back). After rebooting, I lost all of that history.
Is there a macro out there that can do this?

Thanks,

-- Wayne.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Thomas Orgis
2011-03-24 07:43:55 UTC
Permalink
Am Wed, 23 Mar 2011 12:56:22 -0700
Post by Wayne.Lydecker-o70QjBUuf8rQT0dZR+
Is there a way to save (and restore) key stroke history?
This sounds like you want file versioning, storing old revisions, with the ability to undo changes from the whole history. Short: Did you consider a version control system, like Subversion, Mercurial, Git, etc? You for sure could do something like that with NEdit macros, I suppose -- storing editing history along each file -- but that would be a lot of duplicated effort considering that there is a lot of software out there that achieves that for sets of files. You might want to integrate some VCS into NEdit using macros, though ... at each save point adding a new revision of the file to the repository.


Alrighty then,

Thomas.
Wayne.Lydecker-o70QjBUuf8rQT0dZR+
2011-03-24 14:36:12 UTC
Permalink
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Wayne.Lydecker-o70QjBUuf8rQT0dZR+
2011-03-24 15:27:03 UTC
Permalink
It looks like our company's mail servers decided to strip my response
from my
response. Here it is again without the HTML:

Actually, I am using subversion, but that is not what I am referring
to. I'd like to
be able to store editing history so that I can close a file and re-open
it with all
of the keystroke history restored. SVN only captures snap-shots.
Sometimes I need
to back-out the most recent change, or to find the point in the file I
made the
latest change. I frequently use Ctrl-Z and Shft-Ctrl-Z while editing.
It's a very
handy feature. I don't like losing that when I have to close and
re-open file(s).

Thanks,

-- Wayne.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Thomas Orgis
2011-03-25 10:16:12 UTC
Permalink
Am Thu, 24 Mar 2011 08:27:03 -0700
Post by Wayne.Lydecker-o70QjBUuf8rQT0dZR+
Actually, I am using subversion, but that is not what I am referring
to. I'd like to
be able to store editing history so that I can close a file and re-open
it with all
Ok, so you really meant what you wrote;-)
The solution to this problem would still resemble the algorithm of a version control system ... only with much more frequent snapshots. I gather that one could make nedit use a configurable buffer for the undo history (hm, how many does it store, actually?), amounting to a total protocol of editing actions... and then dump that to disk, and also load it from there. One might even devise a format that's a bit more platform / build independent than raw memory dump.

But you could hack NEdit's code with raw dump/restore of the undo data as a first step. The other option would be to train yourself to do more small and frequent commits in SVN to lessen the need for the ultra-history. Or use a virtual file system that commits to svn on each write.

I don't know if someone did this to NEdit already, and I doubt it's a standard feature. But it for sure can be done, technically. Just locate the code dealing with the undo history and add hooks to write the state to disk, also read it from the same. A quick look over the net reveals not much in prior art... just stumbled over http://www.emeditor.com, which can save it's whole state as a workspace, but meh, that's not even Open Source, so it doesn't count;-)


Alrighty then,

Thomas.

Loading...