• Login
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.
  • R
    rinku singh
    last edited by Jan 3, 2019, 8:17 AM

    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
    • R
      rinku singh
      last edited by Jan 3, 2019, 1:45 PM

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

      E 1 Reply Last reply Jan 4, 2019, 1:56 PM Reply Quote 0
      • E
        Eko palypse @rinku singh
        last edited by Jan 4, 2019, 1:56 PM

        @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.

        R 1 Reply Last reply Jan 4, 2019, 2:36 PM Reply Quote 0
        • R
          rinku singh @Eko palypse
          last edited by Jan 4, 2019, 2:36 PM

          @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”

          E 1 Reply Last reply Jan 4, 2019, 2:57 PM Reply Quote 0
          • E
            Eko palypse @rinku singh
            last edited by Jan 4, 2019, 2:57 PM

            @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
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors