diff --git a/source/NVDAObjects/window/scintilla.py b/source/NVDAObjects/window/scintilla.py index 5b7f6949626..31ccf590451 100755 --- a/source/NVDAObjects/window/scintilla.py +++ b/source/NVDAObjects/window/scintilla.py @@ -313,6 +313,16 @@ def _getCharacterOffsets(self, offset): tempOffset -= 1 return [start, end] + def collapse(self, end: bool = False): + """Before collapsing to end, if no text is selected, TextInfo is expanded to line. + This fixes a bug where next braille line command didn't move the cursor to the last empty line + in Notepad++ documents. + https://github.com/nvaccess/nvda/issues/17430 + """ + if end and self.obj.makeTextInfo(textInfos.POSITION_SELECTION).isCollapsed: + self.expand(textInfos.UNIT_LINE) + super().collapse(end=end) + # The Scintilla NVDA object, inherists the generic MSAA NVDA object class Scintilla(EditableTextWithAutoSelectDetection, Window): diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index ee93a100c2f..6347d78e286 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -69,8 +69,9 @@ Specifically, MathML inside of span and other elements that have the attribute ` * If the plugins are reloaded while a browseable message is opened, NVDA will no longer fail to report subsequent focus moves. (#17323, @CyrilleB79) * When using applications such as Skype, Discord, Signal and Phone Link for audio communication, NVDA speech and sounds no longer decrease in volume. (#17349, @jcsteh) * Opening the NVDA Python Console will no longer fail in case an error occurs while retrieving snapshot variables. (#17391, @CyrilleB79) -* In Notepad and other UIA documents on Windows 11, if the last line is empty, the `braille next line command` will move the cursor to the last line. -In any document, if the cursor is on the last line, it will be moved to the end when using this command. (#17251, @nvdaes) +* In Notepad and other UIA documents, and Notepad++ documents on Windows 11, if the last line is empty, the "braille next line command" will move the cursor to the last line. +In any document, if the cursor is on the last line, it will be moved to the end when using this command. +(#17251, #17430, @nvdaes) ### Changes for Developers @@ -119,6 +120,7 @@ As the NVDA update check URL is now configurable directly within NVDA, no replac * `SymphonyDocument.script_toggleTextAttribute` to `SymphonyDocument.script_changeTextFormatting` * The `space` keyword argument for `brailleDisplayDrivers.seikantk.InputGesture` now expects an `int` rather than a `bool`. (#17047, @school510587) * The `[upgrade]` configuration section including `[upgrade][newLaptopKeyboardLayout]` has been removed. (#17191) +* In `NVDAObjects.window.scintilla.ScintillaTextInfo`, if no text is selected, the `collapse` method is overriden to expand to line if the `end` parameter is set to `True` (#17431, @nvdaes) #### Deprecations