Closed nvdaes closed 4 days ago
Thank you! It works most of time but could you investigate situation in ms word when uia is used only when necessary. In windows 11 23h2 and word 2019 I got runtime error.
You could try with text like:
"line 1 line 2 line 3 line 4"
Note that no new line after number 4. Then try to select lines line 3 and line 4 so that you are in the start of line 3, and then press twice shift+down arrow. Then use nvda+alt+home, and try nvda+alt+end. I got following:
Input: kb(laptop):NVDA+alt+end ERROR - scriptHandler.executeScript (13:36:45.912) - MainThread (6848): error executing script: <bound method GlobalCommands.script_review_endOfSelection of <globalCommands.GlobalCommands object at 0x0A4AFA10>> with gesture 'NVDA+alt+end' Traceback (most recent call last): File "scriptHandler.pyc", line 300, in executeScript File "globalCommands.pyc", line 2251, in script_review_endOfSelection File "NVDAObjects\window\winword.pyc", line 1226, in collapse RuntimeError
@burmancomp , please, feel free to test again in MS Word with UIA enabled only when needed or with other configurations and applications. I think that now this is fixed, according to my tests. Now we move the end of the selection info one character back before collapsing, instead of collapsing and then moving back one character.
Works for me, thank you!
Then let's mark this as ready for review.
@SaschaCowley , think that all your suggestions are addressed now. Thanks for your review, and thanks all reviewers.
Link to issue number:
Fixes #17299
Summary of the issue:
NVDA doesn't have commands to move the review cursor to start and end of selection, which may be useful to review the selected text.
Description of user facing changes
NVDA+alt+home
andNVDA+alt+end
can be used to move the review cursor to the first and last carácter of selected text.Description of development approach
In globalCommands.py, GlobalCommands class, a staticmethod has been added to get the current selection. This is used to scripts added to move the review cursor to start and end of selection, similar to other scripts used to move the review cursor.
Testing strategy:
Tested manually in a webpage and in Notepad.
Known issues with pull request:
None.
Code Review Checklist:
@coderabbitai summary