Community
    • Login

    how to get current file status saved or not c# NPPN_FILESAVED

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 1.4k Views 1 Watching
    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.
    • rinku singhR Offline
      rinku singh
      last edited by

      Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_GETCURRENTDIRECTORY, 0, path);

              Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_SAVECURRENTFILE, 0, savedornot);
      
              Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPN_FILESAVED, 0, out path);
      
      1 Reply Last reply Reply Quote 0
      • rinku singhR Offline
        rinku singh
        last edited by

        i have c++ code can you help me out ?

        Eko palypseE 1 Reply Last reply Reply Quote 0
        • Eko palypseE Offline
          Eko palypse @rinku singh
          last edited by

          @gurikbal-singh NPPN… are notifications send by notepad++ to subscribers(plugins) and NPPM… are messages send by plugins to
          notepad++.

          In order to find out what the current status is, I assume, the following needs to be done.
          On npp startup check the status of open buffers with their representation on disk and during runtime
          handle the different notifications accordingly.

          rinku singhR 1 Reply Last reply Reply Quote 0
          • rinku singhR Offline
            rinku singh @Eko palypse
            last edited by

            @Eko-palypse said:

            @gurikbal-singh NPPN… are notifications send by notepad++ to subscribers(plugins) and NPPM… are messages send by plugins to
            notepad++.

            In order to find out what the current status is, I assume, the following needs to be done.
            On npp startup check the status of open buffers with their representation on disk and during runtime
            handle the different notifications accordingly.

            yes i got a message through UnmanagedExports.cs getting NPPN_FILESAVED
            but this is only correspond while save button is clicked

            there are no option example IDM_FILE_SAVEENABED
            actually my question is “how to get current file status saved or not”

            Eko palypseE 1 Reply Last reply Reply Quote 0
            • Eko palypseE Offline
              Eko palypse @rinku singh
              last edited by

              @gurikbal-singh

              afaik, there is no npp api function available to find out if a file is dirty or not.
              As said, you can either compare the current buffer with the file on disk
              or check the menu save item if it is disabled or enabled.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors