• Login
Community
  • Login

Reopen Notepad++ after update, restart or shutdown Windows 10 from where I was

Scheduled Pinned Locked Moved General Discussion
25 Posts 10 Posters 5.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    Andrue Cope
    last edited by Andrue Cope Nov 25, 2019, 8:50 AM Nov 25, 2019, 8:48 AM

    On Friday I discovered part of the problem. I started shutting down my computer prior to leaving work and shutdown was blocked by several applications including Notepad++. When I cancelled shutdown I discovered that Notepad++ was prompting me to reload a file that had changed earlier in the day - in fact the one I like to keep open.

    So I clicked ‘Yes’ to tell it to reload the changed file. What actually happened was that the tab closed, leaving just one other tab.

    And of course when I reloaded Notepad++ today only that other tab has loaded.

    This scenario could be quite common. I’m a programmer and the file I like to keep open will often change as I change branches during the day but I don’t always notice.

    This is with 7.8.1.

    G 1 Reply Last reply Nov 27, 2019, 4:23 PM Reply Quote 1
    • G
      Greg Parrott @Andrue Cope
      last edited by Nov 27, 2019, 4:23 PM

      @Andrue-Cope I have the session issue with 7.8.1. In the past if my laptop refused to wake up from sleep mode, a power cycle did not affect the session at all… all open files, all changed files, all “new” files would come back up right where I left them. Now, changes are lost as are new files. I hope there is a fix for this as it is one of my favorite features (out of many) of Npp.

      E 1 Reply Last reply Nov 28, 2019, 1:30 PM Reply Quote 0
      • E
        Ekopalypse @Greg Parrott
        last edited by Nov 28, 2019, 1:30 PM

        @Greg-Parrott
        Sorry, but this doesn’t make sense to me.
        Npp writes the new session information on application exit and this
        has been since it was introduced, as far as I know.

        So, when putting a laptop in standby it will comeback with the current
        used files on a normal wake up but it won’t comeback with the newly
        added files on a power cycle as it hasn’t been written those new files to
        session.xml yet. The same might happen if npp gets forced to exit.
        If there is no time to write to session.xml those new files get lost.

        The only way to make it work, to have the newly created files get saved
        in session.xml always, would be to add them whenever one creates a
        new one or opens an existing one. But this, obviously, has a drawback
        as well, the session.xml would get written constantly and in terms of
        performance, IO operations are one of the worst things, not to
        mention that maybe 99% of those operations might be useless as the
        files get closed during runtime.

        A G 2 Replies Last reply Nov 28, 2019, 4:21 PM Reply Quote 1
        • A
          Andrue Cope @Ekopalypse
          last edited by Nov 28, 2019, 4:21 PM

          Well I think what I’ve seen is a bug. If I’m asked ‘Do you want to reload the file?’ and I click [Yes] then that’s what it should do whereas it actually closed the tab. I’ll try and replicate it tomorrow as Friday night is when I normally give my work machine a rest.

          E 1 Reply Last reply Nov 28, 2019, 4:49 PM Reply Quote 0
          • E
            Ekopalypse @Andrue Cope
            last edited by Nov 28, 2019, 4:49 PM

            @Andrue-Cope

            Just to be sure, 100% agreed - your case, "Do you … ", should be handled having those open tabs in mind.

            A 1 Reply Last reply Dec 2, 2019, 10:04 AM Reply Quote 0
            • G
              Greg Parrott @Ekopalypse
              last edited by Nov 29, 2019, 12:25 AM

              @Ekopalypse Thanks for the reply. I just did a little controlled experiment and I see where the “new” behavior may be.

              With my saved list of opened files… the ones I really care about… loaded. I created a new file with junk in it and left it unsaved. I created a second file, saved it, and then added some changes and left it that way. Then I closed NPP.

              Past behaviour would be NPP would exit without any further input. Restarting NPP would open my session where it left off with saved files, new unsaved files, and changed files retaining their changes. This is what I am accustomed to.

              However, with this last update, I now get a question asking if I want to save each file “needing” a save. I want the state saved, but I don’t necessarily want them written to disk by the filename or “New x”. So what I am seeing is different from what Andrue is seeing.

              I may try to roll back this update if I can still get the older executables.

              E 1 Reply Last reply Nov 29, 2019, 12:32 PM Reply Quote 0
              • E
                Ekopalypse @Greg Parrott
                last edited by Nov 29, 2019, 12:32 PM

                @Greg-Parrott

                I guess I see. What I assume is that the session setting isn’t set anymore.
                As far as I remember this setting was set with previous npp versions automatically but since some recent versions the community asked to change this to not set.
                In order to get the same behavior as with your previous version you need to goto
                Settings->preferences->Backup and tick
                Remember current session …
                and if new, aka unsaved files, should also be available tick
                Enable session snapshot …

                G 1 Reply Last reply Nov 29, 2019, 3:36 PM Reply Quote 2
                • G
                  Greg Parrott @Ekopalypse
                  last edited by Nov 29, 2019, 3:36 PM

                  That did it. I needed enable session snapshot. That one setting was all I needed… darn lost a days work because of that. Thanks @Ekopalypse.

                  A 1 Reply Last reply Nov 29, 2019, 4:54 PM Reply Quote 2
                  • A
                    Alan Kilborn @Greg Parrott
                    last edited by Nov 29, 2019, 4:54 PM

                    @Greg-Parrott

                    You are perhaps living dangerously with this workflow. If I were you, I would name and save files to disk yourself, and then have a separate backup mechanism that doesn’t involve Notepad++.

                    1 Reply Last reply Reply Quote 2
                    • A
                      Andrue Cope @Ekopalypse
                      last edited by Dec 2, 2019, 10:04 AM

                      @Ekopalypse It did the same thing. This time though I re-opened my file and it was there when I launched NPP this morning. I usually only give Windows half a minute to shut down then force shut down so I’m guessing that this is what’s tripping me up.

                      Whether fixing the prompt handling would also fix my typical scenario I don’t know. Possibly not.

                      E 1 Reply Last reply Dec 2, 2019, 4:11 PM Reply Quote 0
                      • E
                        Ekopalypse @Andrue Cope
                        last edited by Dec 2, 2019, 4:11 PM

                        @Andrue-Cope

                        Half a minute should be more than enough for an app to save its settings but …
                        I only have win10 in a VM so it isn’t that convinient to do testing on this
                        and digging through the code didn’t reveal anything obvious.
                        Just while writing this I think it might be ok to create some tests using
                        WM messages only and not restarting the VM always.
                        I’ll come back on this.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Softone_
                          last edited by Apr 15, 2021, 8:24 AM

                          I can confirm this as of version 7.9.5.

                          This is the scenario:

                          • Notepad++ is open and has several open tabs, both named (=saved) and unnamed (new nn) files
                          • Windows 10 performs an automated reboot as part of a bigger update overnight
                          • After logging in, Notepad++ session is lost
                          • unnamed files can be found on the backup dir, but there is no trace of what saved files were open

                          Notepad++ can remember the session if I manually reboot the win10.

                          Would it make sense to backup the complete session information also every time the backup is performed?

                          Thanks,

                          J 1 Reply Last reply May 14, 2021, 11:47 AM Reply Quote 0
                          • J
                            Joe Halleck @Softone_
                            last edited by May 14, 2021, 11:47 AM

                            @Softone_
                            Same issue here with latest version of Windows 10 and Notepad++
                            I opened an issue with my build details.
                            https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9850

                            1 Reply Last reply Reply Quote 2
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors