Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDA fails to correctly announce deleted text when using Control+Backspace #17630

Open
tarikhadzirovicofficial opened this issue Jan 16, 2025 · 2 comments
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.

Comments

@tarikhadzirovicofficial

NVDA incorrectly announces parts of words when the Control+Backspace shortcut is used to delete text. Instead of announcing only the deleted word, NVDA announces the entire word preceding the cursor, even if only part of it was deleted.

Steps to reproduce:

  1. Open any edit field.
  2. Type "NonVisual Desktop Access" as an example.
  3. Place the cursor between the letters "n" and "V".
  4. Press Control+Backspace.

Actual behavior:

NVDA announces "NonVisual," even though only "Non" (the word preceding the cursor) is deleted.

Expected behavior:

NVDA should announce only "Non," since that is the deleted part of the word "NonVisual".

Additional information:

  • NVDA version: NVDA 2024.4 34423 (installed).
  • Windows version: Windows 11 23H2 (AMD64) build 22631.4602.
  • Software: Issue occurs in any edit field.

Other questions

Does the issue still occur after restarting your computer?

Yes.

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

Yes, the behaviors are the same.

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?

Yes.

@WxnChen11
Copy link
Contributor

Im interested in working on this, does anyone have insights on where to begin?

@SaschaCowley
Copy link
Member

@WxnChen11 I'd try starting with

nvda/source/editableText.py

Lines 267 to 295 in 19296bf

def _backspaceScriptHelper(self, unit, gesture):
try:
oldInfo = self.makeTextInfo(textInfos.POSITION_CARET)
except: # noqa: E722
gesture.send()
return
oldBookmark = oldInfo.bookmark
testInfo = oldInfo.copy()
try:
res = testInfo.move(textInfos.UNIT_CHARACTER, -1)
except COMError:
log.exception("Error in testInfo.move")
gesture.send()
return
if res < 0:
testInfo.expand(unit)
delChunk = testInfo.text
else:
delChunk = ""
gesture.send()
caretMoved, newInfo = self._hasCaretMoved(oldBookmark)
if not caretMoved:
return
delChunk = delChunk.replace("\r\n", "\n") # Occurs with at least with Scintilla
if len(delChunk) > 1:
speech.speakMessage(delChunk)
else:
speech.speakSpelling(delChunk)
self._caretScriptPostMovedHelper(None, gesture, newInfo)

@gerald-hartig gerald-hartig added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

No branches or pull requests

4 participants