Notepad3: Screen reader support for selection tracking is broken

Created on 30 Mar 2021  路  21Comments  路  Source: rizonesoft/Notepad3

In recent versions of Notepad3 screen reader support for announcing text selection changes doesn't work properly.
When selecting text with Shift+Arrow shortcuts NVDA doesn't reliably announce every selected character, word or line. All other Scintilla-based editors I tested, including Notepad++, SciTE and other Notepad2 forks don't exhibit this weird behavior.
This is consistently reproducible with modern versions of NVDA, including development snapshots. I haven't tested this with other screen readers.

Most helpful comment

@RaiKoHoff The latest revision seems to be working really well. Thanks for the great work!

All 21 comments

Notepad3 is the only Scintilla based editor (I know so far), which maintains a undo/redo stack for selections, but I don't see how this should influences a Screen Reader 馃.
On the other hand, you are talking about "recent versions of Notepad3". This implies, that some time ago, Notepad3 does not show this behaviour, you describe here. It would help a lot to name the last "working" version to get a hint towards related changes, which might have a side-effect like this.

Notepad3 is the only Scintilla based editor (I know so far), which maintains a undo/redo stack for selections, but I don't see how this should influences a Screen Reader 馃.
On the other hand, you are talking about "recent versions of Notepad3". This implies, that some time ago, Notepad3 does not show this behaviour, you describe here. It would help a lot to name the last "working" version to get a hint towards related changes, which might have a side-effect like this.

Unfortunately, it seems i was wrong when saying that this is a recent bug. Now I've tested RC_5.20.218.2, and it is fully affected by this. I couldn't find builds older than this one.

Maybe @hpwamr can help you to find older ones.

Hello @a11cf0 ,
In issue #1129, in the fifth list you can find all OLD beta/rc since "2018/11/23" ("BetaBuild_until_release_5.19.108.1602.7z"). 馃

Archive BETA/RC PortableApps (with all BETA/RC PortableApps versions for a period)
BetaBuild_until_release_5.21.227.1.7z
BetaBuild_until_release_5.20.915.1.7z
BetaBuild_until_release_5.20.722.1.7z
BetaBuild_until_release_5.20.411.2_(2020).7z
BetaBuild_until_release_5.20.411.2_(2019).7z
BetaBuild_until_release_5.19.815.2595.7z
BetaBuild_until_release_5.19.630.2381.7z
BetaBuild_until_release_5.19.108.1602.7z

If you need a more older version I can go up to Notepad3_3.18.223.908 ( February,23 2018 )

After testing the provided beta builds I've found that the first broken build is 5.19.828.2602 and the last working one is 5.19.827.2601.

Hello @RaiKoHoff ,
It seems that the pivot PR is: Commit: 5e78d51abef749d982d15eccfc775fb1853a8b89

Commit: 5e78d51abef749d982d15eccfc775fb1853a8b89 [5e78d51]
Parents: eca1199186
Author: Rainer Kottenhoff
Date: mercredi 28 ao没t 2019 9:48:17
Committer: Rainer Kottenhoff
+ fix: new undo transaction split
+ chg: menu entry of undo transaction split at line-breaks

2021-03-30_201354

BTW, disabling undo transaction split doesn't change anything.

Please also ensure that [Settings2] UndoTransactionTimeout=0 (_or undefined_).

@RaiKoHoff, Yes, it's commented out by default. Uncommenting and setting it to an empty value doesn't help either.

It is poking around in the dark, but try to turn OFF "Occurrences Marking" (Menu->View->Mark Occurrences->Active).

@RaiKoHoff, This has no effect.

@RaiKoHoff, Your latest undo transaction split changes don't seem to affect this issue in any way. This issue manifests itself quite randomly, but I'll try to illustrate it. For example, when selecting by character, the first one is announced, the second and third are not, and after selecting the fourth one all the previous ones are finally reported as if they were selected only at this point. Off course, the results are always different on every selection attempt.
Also, enabling Split Undo Typing Sequence on Line Breaks option in the old working beta build doesn't cause this issue.

Hello @a11cf0

Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_5.21.331.1_beta.paf" or newer, see 1st list in issue #1129.

"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.

Also, feel free to test the "BETA/RC Setup", version "Notepad3_5.21.331.1_beta_Setup" or newer, see the 2nd list in issue #1129.

Comments and suggestions are welcome... 馃槂

@hpwamr : From @a11cf0 latest comments, I assume he builds a NP3 version locally.
@a11cf0 : I have no idea (yet) how to fix that currently - I can't really see, that the "split undo transaction" feature has anything to do with that 馃. Maybe another commit on/after 28th August 2019 ?
Ed.: Maybe need also information, how NVDA hooks into the applications to get notified for selection change 馃

@RaiKoHoff, 5e78d51 is indeed the offending commit. I've triple tested that by building different NP3 revisions from source. The strange thing is that in this revision selection tracking is broken regardless of the undo transaction split settings. However, in the previous commit eca1199186f36e87d68 this bug doesn't show up at all no matter what I do.

I've finally found the exact change which causes this bug. It is in _MQ_AppendCmd(). Reverting the code of this function to eca1199 fixes it completely.

Even just a change of

if (pmqc->delay < 2)

to

if (cycles < 2)

fixes this.

I did a complete refactoring of the "delayed message queue" handling.
Also check the implications of your change (if not solved by the refactoring).

@RaiKoHoff In the refactored version this bug is much less frequent But is still certainly present.

@RaiKoHoff The latest revision seems to be working really well. Thanks for the great work!

@a11cf0 : Thank you for your patient support 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hpwamr picture hpwamr  路  3Comments

dlong500 picture dlong500  路  3Comments

craigo- picture craigo-  路  4Comments

blackcrack picture blackcrack  路  3Comments

bravo-hero picture bravo-hero  路  3Comments