nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.12k stars 637 forks source link

problems when last line in notepad contains only one character #17402

Open burmancomp opened 2 days ago

burmancomp commented 2 days ago

Steps to reproduce:

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

alpha-34581,32245d46 (2025.1.0.34581)

Windows version:

windows 11 23h2

Name and version of other software in use when reproducing the issue:

notepad

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Have you tried any other versions of NVDA? If so, please report their behaviors.

If NVDA add-ons are disabled, is your problem still occurring?

yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Adriani90 commented 2 days ago

I can reproduce that as well.

nvdaes commented 2 days ago

I can also reproduce this. I've performed tests with textInfos, and I think that the carriage return is appended outside the _rangeObj. We can create workarounds in NVDA, or someone may know how to fix it appropriately. Though imo perhaps Microsoft should fix this. @josephsl may know much more about this.

nvdaes commented 2 days ago

Some texts can be the following:

From notepad, with a document which contains a character, for example, "a":

  1. Press the arrow key to the end of the line
  2. Open the Python console
  3. Type: i=focus.makeTextInfo("all"), and then i.text
  4. Close the Python console, and from the document press the End key.
  5. Repeat steps 2 and 3.

When we press end, we land into a different textInfo. We may create a script so that end key doesn't move there, but just to the last character. I have tried to change the behavior of the UIA textInfo class without success. I guess that issue #17251 is related to this problem. I created PR #17401 If something is proposed for the current issue, I can close this PR.

Adriani90 commented 1 day ago

But if thhe carriage return was outside object range, this issue would occur also on other lines or between every line. Or am I wrong?

burmancomp commented 1 day ago

I noticed one interesting behavior:

When there is document where there is empty line as last line, and caret is there and you press end key you are in the end of previous line. Can you reproduce this?

titet11 commented 1 day ago

@burmancomp

Yes, but that only happens in Windows 11. It hasn't happened to me in Windows 10.

nvdaes commented 1 day ago

Adriani wrote:

But if thhe carriage return was outside object range, this issue would occur also on other lines or between every line. Or am I wrong?

I guess that this happens just in the last return carriage of the document. Not sure.

nvdaes commented 1 day ago

When there is document where there is empty line as last line, and caret is there and you press end key you are in the end of previous line. Can you reproduce this?

I can reproduce it.

josephsl commented 1 day ago

Hi,

I can reproduce this. In order to better investigate this, we need the exact version of Notepad in use (I have 11.2410.17.0); remember that Notepad in Windows 11 is updated via Microsoft Store, so getting the version info is crucial).

Thanks.

nvdaes commented 1 day ago

My Notepad version is the following, reported by SayProductNameAndVersion add-on, published by @XLTechie

Microsoft.WindowsNotepad 11.2409.9.0

Windows version: Windows 11 23H2 (10.0.22631) workstation AMD64

NVDA 2024.4.1

burmancomp commented 1 day ago

I have notepad version 11.2409.9.0.

I think that review cursor behavior is somewhat strange in notepad settings window. If you navigate with review cursor to object where version number and copyright information is shown you may notice that you are directly at "copyright line" of object although line above it shows version number. If you then move line up with review cursor, and then line down again you may notice that whole copyright line is selected which in this context means that if you press nvda+f9 and then twice nvda+f10 you can hear that whole line is copied to clipboard.

It seems also that there is extra caret event when that object is navigated to with "move navigator object to next object" gesture. As far as I understand there should not be caret event then.

Can you reproduce any of these?

burmancomp commented 23 hours ago

After shutting laptop and starting it again I cannot reproduce issues as to strange behavior when moving with review cursor which I told about in my previous comment.