Skip to content

VERSION_VALUE should always have at least 3 digits #11535

@rdipardo

Description

@rdipardo

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

  1. Install Notepad++ 8.4 (64-bit)
  2. Install HTML Tag (1.2.2)
  3. Start Notepad++
  4. Notice that HTMLTag thinks Notepad++ is incompatible:

htmltag_v122_x64

  1. Read this explanation of what went wrong

Method 2

  1. Clone the Notepad++ source tree
  2. Edit PowerEditor/src/resource.h by adding a 0 to the end of the VERSION_VALUE string: #define VERSION_VALUE "8.40"
  3. Repeat steps 2-3 of Method 1
  4. No more issue!

Method 3

  1. Write a plugin that calls into the NPPM_GETNPPVERSION API
  2. Build 4 different Notepad++ binaries with 4 different strings assigned to VERSION_VALUE
  3. 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

Footnotes

  1. https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11431

  2. https://github.com/nvaccess/nvda/pull/13382#issuecomment-1049294658

  3. https://github.com/oleg-shilo/cs-script.npp/issues/64#issuecomment-1108448994

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions