Community
    • Login

    How does npp persist and restore files that were opened between startup?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 306 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.
    • ElusiveTauE
      ElusiveTau
      last edited by

      This is a question about the source code. I’ve asked around about how to persist application data and the general response has been:

      1. Write data to a file (plaintext, serialization)
      2. Write data to a database

      I wanted to know how and where (what source code file/method) NPP handles persistence. Nevermind the question of what I’m trying to do. I’m just interested in how it’s implemented in this text editor.

      One example where I think persistence is used is to open files that were previously closed when the user exits npp. The names of those files must be saved somewhere and execution must know where to look to get the names of those files to reload them when npp is restored.

      I’ve downloaded the source code for npp from github but there are a lot of files to go through. It’d help if you can point me to the right folder/source code/method, etc.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @ElusiveTau
        last edited by

        @ElusiveTau said in How does npp persist and restore files that were opened between startup?:

        persistence is used is to open files that were previously closed when the user exits npp. The names of those files must be saved somewhere

        session.xml

        but there are a lot of files to go through. It’d help if you can point me to…

        Like everybody else that is interested, you have to just dig in.

        ElusiveTauE 1 Reply Last reply Reply Quote 2
        • ElusiveTauE
          ElusiveTau @Alan Kilborn
          last edited by

          @Alan-Kilborn Thanks Alan. For posterity this mentions it’s on the AppData path.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @ElusiveTau
            last edited by

            @ElusiveTau

            But it isn’t always on the “appdata” path. I could be located in the same folder as notepad++.exe is! In fact, that’s my preferred place for it.

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