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.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.
    • rinku singhR
      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
        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
          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
            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
              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
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors