Ensure named files saved on exit

  • On a couple occasions recently I have been surprised to discover that the version of code that I backed up on our Source Control System to access from a separate computer was not the version I last edited in Notepad++, but a previous version, even though Npp showed the correct version when I returned to the original file.

    In the past (possibly dim and distant), when you exited Npp, you were prompted to save all modified files.

    Now, it seems that Npp saves the state of everything and restores it on the next run and (including unsaved files, which start up again marked unsaved). This means that I had not lost anything (good), but as the second computer was at a different site (home), I had no access to the modified file (bad).

    I am sure that there is a way in the Preferences to make the system prompt me to save modifed files on exit, but I could not see an obvious setting… Perhaps this is part of the Backup on Save??? If so, can we have the options labelled so it is clearer what they mean: “Prompt to save modified files on Exit” would be nice and clear.

    Apologies if I have missed something obvious.

  • @Greg-Smith

    You probably have Enable session snapshot and periodic backup ticked in Settings (menu) -> Preferences… -> Backup (box on left).

    Untick that and you should be prompted if you try to quit Notepad++ with unsaved files open in editor tabs.

  • Yes it was checked, but if I un-check it I do not get my last session restored, which is a pain as I want to continue where I left off and I have a lot of windows open.

    How do I get the behavior, which I feel that I used to have, of restoring the previous session but also to be prompted to save any edits made in this (or any previous) session?

    To re-iterate:
    It is easy to accidentally leave edits behind in a complex multi-document arrangement when your work pattern involves backup to a Source Control System, which can be very frustrating if you work in several places on different machines.

  • @Greg-Smith You might want to try out the Session Manager plug-in to keep track of not only your “current” session, but any number of previous ones too. See: http://mfoster.com/npp/SessionMgr.html

  • @Greg-Smith

    Well, here’s the way I have mine set, and I get:

    • session restore (to pick up with the files I was working with last time)
    • prompted upon exiting to save any red tabs (unsaved files)


Log in to reply