Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/NVDAObjects/window/scintilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Comment thread
nvdaes marked this conversation as resolved.
Resolved

# The Scintilla NVDA object, inherists the generic MSAA NVDA object
class Scintilla(EditableTextWithAutoSelectDetection, Window):
Expand Down
8 changes: 2 additions & 6 deletions source/textInfos/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,7 @@ def unitCount(self, unit):
else:
raise NotImplementedError

allowMoveToOffsetPastEnd = True
"""
We can move 1 past story length to allow braille routing to end insertion point. (#2096)
Furthermore, review cursor is able to reach the last, empty line in some controls, like Scintilla. (#18348)
"""
allowMoveToOffsetPastEnd = True #: move with unit_character can move 1 past story length to allow braille routing to end insertion point. (#2096)
Comment thread
nvdaes marked this conversation as resolved.
Resolved

def move(self, unit, direction, endPoint=None):
if direction == 0:
Expand All @@ -663,7 +659,7 @@ def move(self, unit, direction, endPoint=None):
count = 0
lowLimit = 0
highLimit = self._getStoryLength()
if self.allowMoveToOffsetPastEnd:
if self.allowMoveToOffsetPastEnd and unit == textInfos.UNIT_CHARACTER:
# #2096: There is often an uncounted character at the end of the text
# where the caret is placed to append text.
highLimit += 1
Expand Down
2 changes: 1 addition & 1 deletion tests/system/robot/chromeTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def test_pr11606():
actualSpeech = _chrome.getSpeechAfterKey("end")
_asserts.strings_match(
actualSpeech,
"blank",
"link",
)
# Read the current line.
# Before pr #11606 the next line ("C D") would have been read.
Expand Down
2 changes: 0 additions & 2 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ Please open a GitHub issue if your add-on has an issue with updating to the new
* typing_extensions have been removed.
These should be supported natively in Python 3.13. (#18689)
* `copyrightYears` and `url` have been moved from `versionInfo` to `buildVersion`. (#18682)
* Fixed behavior of `TextInfo.collapse()` - previously it was moving TextInfo to the next paragraph in some cases. (#18320, @mltony)
* Fixed behavior of `OffsetTextInfo.move()` - previously it wouldn't move to the very end of the document unless moving by character. (#18348, @mltony)
* `NVDAHelper.localLib` is now a module, not a `ctypes.CDLL`.
Most API consumers should not be impacted by this change.
Use `NVDAHelper.localLib.dll` for access to the `ctypes.CDLL` if necessary. (#18207)
Expand Down
Loading