This patch adds several new plugin notifications as discussed on this thread:
https://sourceforge.net/p/notepad-plus/discussion/482781/thread/bdb6269d/
The feature request about that is:
https://sourceforge.net/p/notepad-plus/feature-requests/2554/
The following notifications are added:
NPPN_BEFORESHUTDOWN - notifies about shutdown event but before files are actually closed
NPPN_CANCELSHUTDOWN - shutdown is cancelled
NPPN_FILEBEFOREBACKUP - file is about to be backup
NPPN_FILEBACKUPDONE - successful file backup
NPPN_FILEBACKUPFAILED - file backup failed
NPPN_FILEBEFORERENAME - file is about to be renamed, user can get the old name from bufID
NPPN_FILERENAMED - file is renamed, user can get the new name from bufID
NPPN_FILEBEFOREDELETE - file deletion initiated from Npp, user can get name from bufID
NPPN_FILEDELETED - file deleted. If NPPN_FILEBEFOREDELETE is received before NPPN_FILEDELETED then deletion is from Npp and the buffer will be closed before receiving this notification, bufID will be -1. If deletion is from outside Npp no NPPN_FILEBEFOREDELETE will be sent and the user will receive NPPN_FILEDELETED before the "keep document in editor" dialog appears. User can get file name from bufID in this case.
Please use patch version 2 attached with this post.
It has correct line endings (I am developing on Linux and erroneously submitted the initial patch with LF line endings).
It also can be applied together with this patch:
https://sourceforge.net/p/notepad-plus/patches/633/
The initial version has conflicts with patch 633.
It's OK to add the notifications mentioned above, except the 3 following notifications:
NPPN_FILEBEFOREBACKUP - file is about to be backup
NPPN_FILEBACKUPDONE - successful file backup
NPPN_FILEBACKUPFAILED - file backup failed
My question is why a plugin need to monitoring these 3 events?
Don
Honestly Don, I do not know.
I have implemented all notifications that were suggested by plugin developers in this thread:
https://sourceforge.net/p/notepad-plus/discussion/482781/thread/bdb6269d/,
except the ones connected to workspace and project.
Can you post your question to the above-mentioned thread?
I can also strip those 3 notifications from this patch and if those are considered useful later we can make another one adding them what do you think?
BR,
Pavel
Here is the patch without the file backup notifications. Notifications for rename and delete failures are added.
I have moved file backup notifications to separate patch here:
https://sourceforge.net/p/notepad-plus/patches/649/
The following notifications are added:
NPPN_BEFORESHUTDOWN - notifies about shutdown event but before files are actually closed
NPPN_CANCELSHUTDOWN - shutdown is cancelled
NPPN_FILEBEFORERENAME - file is about to be renamed, user can get the old name from bufID
NPPN_FILERENAMECANCEL - file rename has been cancelled
NPPN_FILERENAMED - file is renamed, user can get the new name from bufID
NPPN_FILEBEFOREDELETE - file deletion initiated from Npp, user can get name from bufID
NPPN_FILEDELETEFAILED - file deletion initiated from Npp has failed
NPPN_FILEDELETED - file deleted. If NPPN_FILEBEFOREDELETE is received before NPPN_FILEDELETED then deletion is from Npp and the buffer will be closed before receiving this notification, bufID will be -1. If deletion is from outside Npp no NPPN_FILEBEFOREDELETE will be sent and the user will receive NPPN_FILEDELETED before the "keep document in editor" dialog appears. User can get file name from bufID in this case.