Powerful rollback for multiple edits (feature request?)browsing

“rollback to just before most recent save” for one, or all open tabs in one go

Why? After multiple edits in different files/tabs in a project, I typically do “Save All” and run some tests. Sometimes I want to go back to what I started with in the first place, but all files have changed. Hence: rollback, please!

The current "solution"is to “Save all”, “Close All” and reopen a bunch of files. Not very efficient.

in the current situation, as you’ve described, you do not start with your initial state as save all
did overwrite it. What do I miss?

In theory it should work if you use a scripting language or npp_exec and do a
beginUndoAction first, now modify your sources and do your tests and afterwards another
script calls endUndoAction and Undo.
I said in theory because I did not test.

I could offer a possible solution but therefore you would need to either install
nppexec or a scripting language plugin like python/lua script.

If you want to try to go this way, which plugin do you prefer?
The scripting plugins give you access to most of the functionality npp and scintilla offers.
But there is a need to learn that language if you want to extend functionality by your own.
NppExec is also powerful but more easy to use if you don’t have any programming skills.

Harry D. Why are you doing the close-all and reopen-a-bunch-of-files steps? I take advantage of that npp remembers the tabs and position within each tab. You can do save-all and Alt-F4 out of NPP. It’ll remember all your tabs when you restart it.

I also take advantage of being able to open NPP session files. For some projects there’s a list of 20 or so files that I want to open each time in NPP. Under the File menu dropdown is Save-Session and Load-Session. The session files are XML though by default don’t have a file extension. I’ve saved session files for various projects to speed up opening the files related to those projects. You can do

and it will open the session for you. If npp is already running then you get more tabs opened.

I could see adding to npp a way to undo a single [Replace in All Opened Documents] if it was the last thing done. It would mean npp would need to keep track of which tabs had a match in the search part and to only do an undo on those tabs. Mixing up undo of Replace-in-All-Opened-Documents with undo of other edits seems like a nightmare. At present npp maintains a separate undo-chain for each tab. an undo-all would somehow be a separate chain that’s also merged with the chains for each tab.

I normally deal with versions and rollbacks for projects using robocopy. I usually work on drive C: and keep a scratchpad USB disk mounted at E: I have a batch file, rbe.bat, that runs robocopy from the current directly to the corresponding directory on E:. If I’m at c:\src\npp I’ll do “rbe /s” to update the E: drive copy of c:\src\npp. rbe will be running “robocopy c:\src\npp e:\src\npp /NJH /NJS /NDL /s” I’ll then make my changes on the C: copy. If I end up messing up and realize it’s better to start over I’ll grab the copy I made on E:. Sometimes I’ll want to keep multiple versions “just in case” and have a batch file named rbt.bat that similar to rbe but it drops the results in a subfolder named 2017-03-09-1457 The 1457 is the current hour/minute.

rbt.bat (pronounced rabbit in my mind) is nearly identical to rbe.bat except that it appends the yyyy-mm-dd-hhmm time stamp to the end of the destination path. I suppose I could make a rbv.bat that did numbered versions instead of time stamps.

Here’s whan rbe.bat looks like though I stripped out some special case handling for when I run it from D: