Closed mo29cg closed 1 year ago
You are relying on offsets, I am worried that this is not going to work in non-offset-based textInfos, like in Thunderbird. _getUnitOffsets is only defined for offsets-based textInfos. Can you try something like: end.setEndPoint(start, "startToStart") Or maybe: start.move(textInfos.UNIT_CHARACTER,endOffset-startOffset, endpoint='end' )
On 5/14/2023 12:32 AM, suzukix wrote:
This is a fix for #30 https://github.com/mltony/nvda-sentence-nav/issues/30.
The problem was that, when it calls setEndPoint in line 368,
start.setEndPoint(end, "endToEnd")
if end was the very end of the contents, it failed to create textInfos correctly, so the text inside the textInfos is empty.
And speech.speakTextInfo also fail to speak the textInfo.
This PR is fixing it by setting the end point in a different way. You can try the difference in here. https://mo29cg.github.io/
Thanks for reading.
You can view, comment on, or merge this pull request online at:
https://github.com/mltony/nvda-sentence-nav/pull/31
Commit Summary
4b524e3 https://github.com/mltony/nvda-sentence-nav/pull/31/commits/4b524e35374276946f8ec55fc6faaf707c87fce6 fixed so that it can read the sentence at the very end
File Changes
(1 file https://github.com/mltony/nvda-sentence-nav/pull/31/files)
M addon/globalPlugins/sentenceNav.py https://github.com/mltony/nvda-sentence-nav/pull/31/files#diff-d7b5ff7e27a1a7429b9df6c50d8ed747668c975143e5c48c8685a4fb16f8551f (11)
Patch Links:
— Reply to this email directly, view it on GitHub https://github.com/mltony/nvda-sentence-nav/pull/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIJRDHD3SCCVBH2DOJB4VL3XGCDBBANCNFSM6AAAAAAYA7T32M. You are receiving this because you are subscribed to this thread.Message ID: @.***>
As you said, I confirmed there was an error trying to go to the last sentence in thundirbird. So, I changed it to move instead. It worked for both browsers and thunderbird.
end.setEndPoint(start, "startToStart") This didn't work by the way.
Thanks for fixing this!
This is a fix for https://github.com/mltony/nvda-sentence-nav/issues/30.
The problem was that, when it calls setEndPoint in line 368,
start.setEndPoint(end, "endToEnd")
if end was the very end of the contents, it failed to create textInfos correctly, so the text inside the textInfos is empty.
And speech.speakTextInfo also fail to speak the textInfo.
This PR is fixing it by setting the end point in a different way. You can try the difference in here. https://mo29cg.github.io/
Thanks for reading.