-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description of the Issue
N++'s VERSION_VALUE resource string sometimes has 3 digits, e.g. "8.33".
But with every "minor version" bump, it's reduced to only 2 digits, e.g. "8.4".
After N++ 8.3.3 comes 8.4, then, perhaps, 8.4.1, then 8.5, etc.
If a plugin is concerned about compatibility, it has to know that 4 comes after 33, and 5 comes after 41.
This is a headache for developers targeting N++'s plugin API 1 2 3.
Steps to Reproduce the Issue
Method 1
- Install Notepad++ 8.4 (64-bit)
- Install HTML Tag (1.2.2)
- Start Notepad++
- Notice that HTMLTag thinks Notepad++ is incompatible:
- Read this explanation of what went wrong
Method 2
- Clone the Notepad++ source tree
- Edit
PowerEditor/src/resource.hby adding a0to the end of theVERSION_VALUEstring:#define VERSION_VALUE "8.40" - Repeat steps 2-3 of Method 1
- No more issue!
Method 3
- Write a plugin that calls into the
NPPM_GETNPPVERSIONAPI - Build 4 different Notepad++ binaries with 4 different strings assigned to
VERSION_VALUE - Run the plugin in each version and note the results:
| HIWORD | LOWORD | N++ version |
|---|---|---|
| 8 | 33 | 8.3.3 |
| 8 | 4 | 8.4 |
| 8 | 41 | 8.4.1 |
| 8 | 5 | 8.5 |
Expected Behavior
Every version string has at least 3 digits, e.g.,
N++ 8.4 -> #define VERSION_VALUE "8.40"
N++ 8.5 -> #define VERSION_VALUE "8.50"
What does the plugin see now?
| HIWORD | LOWORD | N++ version |
|---|---|---|
| 8 | 33 | 8.3.3 |
| 8 | 40 | 8.4 |
| 8 | 41 | 8.4.1 |
| 8 | 50 | 8.5 |
33 . . . 40 . . . 41 . . . 50 . . .
Every new version has a low word greater than the last one! Easy!
Actual Behavior
33 . . . 4 . . . 41 . . . 5 . . .
Debug Information
Notepad++ v8.4 (64-bit)
Build time : Apr 20 2022 - 03:31:06
Path : C:\bin\npp_8.4\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 11 (64-bit)
OS Version : 2009
OS Build : 22000.651
Current ANSI codepage : 1252
Plugins : HTMLTag.dll mimeTools.dll NppConverter.dll NppExport.dll
