Skip to content

Commit 792074e

Browse files
committed
OffsetsTextInfo.move: For UNIT_CHARACTER, allow the character to be 1 past the end, as there is often an uncounted character at the end where the caret is placed to append text.
This means that routing the cursor to the space at the end of the line/paragraph using braille cursor routing keys in some editable text fields now works correctly instead of routing to the start of the text. Fixes #2096.
1 parent f7b2c8a commit 792074e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

source/textInfos/offsets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ def move(self,unit,direction,endPoint=None):
413413
count=0
414414
lowLimit=0
415415
highLimit=self._getStoryLength()
416+
if unit==textInfos.UNIT_CHARACTER:
417+
# #2096: There is often an uncounted character at the end of the text
418+
# where the caret is placed to append text.
419+
highLimit+=1
416420
while count!=direction and (lastOffset is None or (direction>0 and offset>lastOffset) or (direction<0 and offset<lastOffset)) and (offset<highLimit or direction<0) and (offset>lowLimit or direction>0):
417421
lastOffset=offset
418422
if direction<0 and offset>lowLimit:

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Highlights of this release include features for more fluent reading of braille;
6565
- NVDA now restarts itself correctly (e.g. after changing the configured language) when it is located in a directory which contains non-ASCII characters. (#2079)
6666
- Braille correctly respects the settings for reporting of object shortcut keys, position information and descriptions.
6767
- In Mozilla applications, switching between browse and focus modes is no longer slow with braille enabled. (#2095)
68+
- Routing the cursor to the space at the end of the line/paragraph using braille cursor routing keys in some editable text fields no longer routes to the start of the text. (#2096)
6869

6970

7071
== Changes for Developers ==

0 commit comments

Comments
 (0)