Fix autocomplete suggestions not being announced - #42
Open
yukie-nobuharu wants to merge 2 commits into
Open
Conversation
Notepad++'s Scintilla autocomplete popup doesn't expose its item text through MSAA, and its rendering isn't visible to NVDA's display-model screen scraping either - both were confirmed empty via diagnostic logging against a real Notepad++ 8.9.7 session. Read the suggestion text directly from Scintilla instead, via SCI_AUTOCGETCURRENTTEXT, using the same cross-process buffer technique NVDA core already uses to read this editor's document text. Also widens the ListBoxX ancestor match in chooseNVDAObjectOverlayClasses, which assumed a fixed 3-level parent chain that no longer matches the real (5-level) object tree, and adds native-listbox and display-model fallbacks for older/differently themed builds.
Both were confirmed to return no data on the actual popup during investigation. SCI_AUTOCGETCURRENTTEXT has been present in Scintilla long before any Notepad++ version anyone is likely running today, so the extra complexity wasn't justified for a fallback with no observed case. Kept the cheap MSAA read as the only fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix autocomplete suggestions not being announced
Problem
Notepad++'s autocomplete suggestions were not being spoken by NVDA when arrowing through the list — NVDA announced nothing (or "blank"), even though
AutocompleteList.event_selectionwas firing correctly on every selection change. This is a long-standing issue (referenced as far back as nvaccess/nvda#1701).Root cause
Confirmed via diagnostic logging against a live NVDA 2026.1.1 + Notepad++ 8.9.7 session:
chooseNVDAObjectOverlayClassescorrectly matches theListBoxXautocomplete popup and appliesAutocompleteList, andevent_selectionfires correctly on every arrow press.name,value, anddescriptionare all empty.LB_GETTEXT/LB_GETCURSEL) also returns nothing — the control doesn't appear to track selection via standard listbox state either.None of the three failed with an exception — they just cleanly returned no data, which matches this being a genuinely inaccessible custom-drawn control rather than a bug in how the addon reads it.
Fix
Query Scintilla itself for its currently-highlighted autocomplete text, via the documented
SCI_AUTOCGETCURRENTTEXTmessage, using the same cross-process shared-memory technique NVDA core already uses to read this editor's document text (VirtualAllocEx/WriteProcessMemory/ReadProcessMemoryviawinKernel, dispatched withwatchdog.cancellableSendMessage). This bypasses the popup UI entirely and asks the editor's own internal state for the answer, so it doesn't depend on how the popup happens to be rendered or exposed.Decoding respects the document's actual codepage (
SCI_GETCODEPAGE), matching the pattern already used in NVDA core'sScintillaTextInfo._get_encoding, rather than assuming UTF-8.A plain MSAA read (
name/value/description) is kept as a cheap fallback, tried if the Scintilla query returns nothing. The native-listbox (LB_GETTEXT) and display-model screen-read approaches were also tested during investigation and confirmed to return nothing on this control, so they weren't included in the final fix -SCI_AUTOCGETCURRENTTEXThas been present in Scintilla long before any Notepad++ version anyone is likely running today, so the extra complexity didn't seem justified for a benefit with no observed case.Other changes bundled in
AutocompleteListno longer subclassesIAccessibledirectly — it's now a plain mixin, which is unnecessary coupling to one specific accessibility API since NVDA's overlay-class mechanism already combines mixins with whichever underlying API class the real object uses.ListBoxXancestor match inchooseNVDAObjectOverlayClassesassumed a fixed 3-level parent chain; the real chain on current builds is 5 levels deep (ListBox -> ListBox -> ListBoxX -> ListBoxX -> #32769). Widened to walk up to 6 levels.Testing
Manually tested against Notepad++ 8.9.7 (64-bit) with NVDA 2026.1.1 on Windows, editing a
.javafile, confirming autocomplete suggestions are now announced correctly when arrowing through the list. Not tested against older Notepad++/Scintilla versions or 32-bit builds — feedback welcome from anyone who can test those configurations.