You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/plugin-communication.md
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,50 @@ where:
84
84
85
85
---
86
86
87
+
#### [2117]**NPPM_ADDSCNMODIFIEDFLAGS**
88
+
*Add needed `SCN_MODIFIED` flags so your plugin will recieve the notification `SCN_MODIFIED` of these events for your specific treatments. (New to v8.7.7.)*
89
+
90
+
*By default, Notepad++ only forwards `SCN_MODIFIED` with the following 5 flags/events `SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT | SC_PERFORMED_UNDO | SC_PERFORMED_REDO | SC_MOD_CHANGEINDICATOR` to plugins.*
91
+
*If your plugin need to process other events of `SCN_MODIFIED`, you should add the flags you need by sending this message to Notepad++, just after recieving NPPN_READY.*
92
+
*Even if your plugin only uses flags/events that are in those 5, it is recommended to notify Notepad++ of that need.*
93
+
94
+
**Parameters**:
95
+
96
+
*wParam [in]*
97
+
: int, must be zero.
98
+
99
+
*lParam [in]*
100
+
: unsigned long scnMotifiedFlags2Add, a bitwise-OR of the `SCN_MODIFIED` constants indicating which flags/events your plugin needs Notepad++ to forward.
101
+
102
+
**Return value**:
103
+
: Returns True
104
+
105
+
**Example:**
106
+
The following tells Notepad++ that your plugin needs the `SC_MOD_DELETETEXT` and `SC_MOD_INSERTTEXT` flags/events:
It is best practice to include _all_ flags/events that are needed by your plugin, even if they are in the list of default flags (like the `SC_MOD_DELETETEXT` and `SC_MOD_INSERTTEXT` are in the example), as this clearly communicates to Notepad++ the needs of your plugin. (It is possible, in the future, that the list of default flags/events will be changed, or that Notepad++ may be able to provide more performance optimizations if plugins indicate all the flags/events that they need.)
126
+
127
+
---
128
+
87
129
#### [2065]**NPPM_ADDTOOLBARICON**[DEPRECATED]
88
-
*Deprecated in v8.0. Use NPPM_ADDTOOLBARICON_FORDARKMODE instead. Does not support
89
-
the Darkmode icons.*
130
+
*Deprecated in v8.0. Use NPPM_ADDTOOLBARICON_FORDARKMODE instead. Does not support the Darkmode icons.*
90
131
91
132
*`NPPM_ADDTOOLBARICON_DEPRECATED`: Adds an icon to the toolbar.
92
133
This function only makes sense if called on response to NPPN_TBMODIFICATION notification.
@@ -1211,7 +1252,8 @@ MAX_PATH is suggested to use.*
1211
1252
1212
1253
#### [2140]**NPPM_GETNATIVELANGFILENAME**
1213
1254
*Get the Current native language file name string. Use it after getting NPPN_READY notification to find out which native language is used.*
1214
-
Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character), allocate language file name string buffer with the return value + 1, then call it again to get the current native language file name string.*
1255
+
1256
+
*Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character), allocate language file name string buffer with the return value + 1, then call it again to get the current native language file name string.*
0 commit comments