Repository: nvaccess/nvda

Issue:
Recent alpha versions crash Notepad++ versions 8.2.x and below
<!-- Please read the text in this edit field before filling it in.
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/blob/master/devDocs/githubIssueTemplateExplanationAndExamples.md
Please also note that the NVDA project has a Citizen and Contributor Code of Conduct which can be found at https://github.com/nvaccess/nvda/blob/master/CODE_OF_CONDUCT.md. NV Access expects that all contributors and other community members read and abide by the rules set out in this document while participating or contributing to this project. This includes creating or commenting on issues and pull requests. 

Each of the questions and sections below start with multiple hash symbols (#). Place your answers and information on the blank line below each question.
-->

### Steps to reproduce:
1. Use NVDA alpha version nvda_snapshot_alpha-24771,a1a6598b.exe or above.
2. Open Notepad++ v8.1.x or v8.2.x 64-bit.
3.Press up/down a few times.

### Actual behavior:
Notepad++ crashes. No error message is printed in NVDA log.
### Expected behavior:
Notepad++ should not crash.
### System configuration
#### NVDA installed/portable/running from source:
Portable alpha nvda_snapshot_alpha-24771,a1a6598b.exe
#### NVDA version:
nvda_snapshot_alpha-24771,a1a6598b.exe

#### Windows version:
Reproduced on both Windows 10 and 11 64-bit.
#### Name and version of other software in use when reproducing the issue:
Reproduced using either of these two versions (64-bit in both cases):
- Notepad++ v8.1.9.3: https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.1.9.3/npp.8.1.9.3.portable.x64.zip
- Notepad++ v8.2.1: https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.2.1/npp.8.2.1.portable.x64.zip
#### Other information about your system:
N/A
### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Identified that commit a1a6598b19f71bd108bef64373dd35c89c14cd4a is causing this, therefore cc: @lukaszgo1.
#### If NVDA add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes


Discussion:

Resolving patch:
diff --git a/source/appModules/notepadPlusPlus.py b/source/appModules/notepadPlusPlus.py
--- a/source/appModules/notepadPlusPlus.py
+++ b/source/appModules/notepadPlusPlus.py
@@ -46,7 +46,12 @@ class NppEdit(ScintillaBase.Scintilla):
 	def _get_TextInfo(self):
 		if self.appModule.is64BitProcess:
 			appVerMajor, appVerMinor, *__ = self.appModule.productVersion.split(".")
-			if int(appVerMajor) >= 8 and int(appVerMinor) >= 3:
+			# When retrieving the version, Notepad++ concatenates
+			# minor, patch, build in major.minor.patch.build to the form of major.minor
+			# https://github.com/notepad-plus-plus/npp-usermanual/blob/master/content/docs/plugin-communication.md#nppm_getnppversion
+			# e.g. '8.3' for '8.3', '8.21' for '8.2.1' and '8.192' for '8.1.9.2'.
+			# Therefore, only use the first digit of the minor version to match against version 8.3 or later.
+			if int(appVerMajor) >= 8 and int(appVerMinor[0]) >= 3:
 				return ScintillaTextInfoNpp83
 		return super().TextInfo
 


Test patch: