Skip to content

Commit 2591d8d

Browse files
authored
Merge cdcd270 into c32e0e7
2 parents c32e0e7 + cdcd270 commit 2591d8d

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

source/NVDAObjects/window/scintilla.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,16 @@ def _getCharacterOffsets(self, offset):
313313
tempOffset -= 1
314314
return [start, end]
315315

316+
def collapse(self, end=False):
317+
"""Before collapsing to end, if no text is selected, TextInfo is expanded to line.
318+
This fixes a bug where next braille line command didn't move the cursor to the last empty line
319+
in Notepad++ documents.
320+
https://github.com/nvaccess/nvda/issues/17430
321+
"""
322+
if end and self.obj.makeTextInfo(textInfos.POSITION_SELECTION).isCollapsed:
323+
self.expand(textInfos.UNIT_LINE)
324+
super().collapse(end=end)
325+
316326

317327
# The Scintilla NVDA object, inherists the generic MSAA NVDA object
318328
class Scintilla(EditableTextWithAutoSelectDetection, Window):

user_docs/en/changes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Specifically, MathML inside of span and other elements that have the attribute `
6868
* If the plugins are reloaded while a browseable message is opened, NVDA will no longer fail to report subsequent focus moves. (#17323, @CyrilleB79)
6969
* 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)
7070
* Opening the NVDA Python Console will no longer fail in case an error occurs while retrieving snapshot variables. (#17391, @CyrilleB79)
71-
* 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.
72-
In any document, if the cursor is on the last line, it will be moved to the end when using this command. (#17251, @nvdaes)
71+
* In Notepad and other UIA documents, and Notepad++ on Windows 11, if the last line is empty, the `braille next line command` will move the cursor to the last line.
72+
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)
7373

7474
### Changes for Developers
7575

@@ -116,6 +116,7 @@ As the NVDA update check URL is now configurable directly within NVDA, no replac
116116
* `SymphonyDocument.script_toggleTextAttribute` to `SymphonyDocument.script_changeTextFormatting`
117117
* The `space` keyword argument for `brailleDisplayDrivers.seikantk.InputGesture` now expects an `int` rather than a `bool`. (#17047, @school510587)
118118
* The `[upgrade]` configuration section including `[upgrade][newLaptopKeyboardLayout]` has been removed. (#17191)
119+
* 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)
119120

120121
#### Deprecations
121122

0 commit comments

Comments
 (0)