Skip to content

Fix NVDA may freeze when copying large amount of text (#11843)#11852

Merged
michaelDCurran merged 1 commit into
nvaccess:masterfrom
accessolutions:i11843-copyLengthyText
Nov 22, 2020
Merged

Fix NVDA may freeze when copying large amount of text (#11843)#11852
michaelDCurran merged 1 commit into
nvaccess:masterfrom
accessolutions:i11843-copyLengthyText

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #11843
Fix-up of #9843

Summary of the issue:

Depending on the speech synthesizer in use, NVDA may freeze when attempting to report a lengthy text as it has been copied to clipboard.

Description of how this pull request fixes the issue:

As when reporting selection or clipboard content, report the number of character instead of the whole text when it exceeds a certain amount.

Clipboard reporting limits to 512. Selection reporting limits to 1024.
speech._getSelectionMessageSpeech limits to 512 characters and simply reports "%d characters"
globalCommands.script_reportClipboardText limits to 1024 characters and reports "The clipboard contains a large portion of text. It is %s characters long"

I've thus gone the middle way: Limit to 1024 and simply report "%d characters copied to clipboard".

Testing performed:

Successfully tested #11843 STR.

Known issues with pull request:

The translatable literal "%d characters" does not meet the new standard ("{nb} characters") but I've thought re-using the existing message would spare translation efforts.

Change log entry:

I don't think this deserves a change log entry.

@OzancanKaratas OzancanKaratas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested and it looks good to me.

@CyrilleB79

Copy link
Copy Markdown
Contributor

I have tested it and the freeze does not occur anymore. So it is OK for me.

I have just noticed that the number of selected characters and the number of copied characters is not exactly the same (tested on the World War I article of Wikipedia).
IMO, that minor issue should not block this PR since the number of characters reported is only an indication of how much text is selected/copied; a precise number is not required.

@michaelDCurran michaelDCurran merged commit 043ca83 into nvaccess:master Nov 22, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Nov 22, 2020
@JulienCochuyt JulienCochuyt deleted the i11843-copyLengthyText branch November 23, 2020 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA freeze when copying large amount of text

5 participants