Skip to content

fix: Clear auto-suggestion menu list when no completions match#1631

Merged
gnodet merged 1 commit intomasterfrom
fix/auto-menu-list-clear
Feb 19, 2026
Merged

fix: Clear auto-suggestion menu list when no completions match#1631
gnodet merged 1 commit intomasterfrom
fix/auto-menu-list-clear

Conversation

@gnodet
Copy link
Member

@gnodet gnodet commented Feb 18, 2026

Summary

  • Fixes auto suggestion list not closed when there are no matching completions #1338: AUTO_MENU_LIST completion menu stays visible when no candidates match
  • The autosuggestion flow calls clearChoices() then listChoices(true) on every keystroke. clearChoices() called doList(emptyList, ...), but doList() returns early at the possibleSize == 0 check (line 5184) without clearing the post field. The stale post lambda from the previous completion continued to render old candidates
  • When listChoices(true) subsequently finds no matches, it also returns early without touching post
  • Fix: clearChoices() now directly sets post = null instead of delegating to doList() with an empty list

Test plan

  • Reader module compiles and all tests pass
  • Manual test: enable AUTO_MENU_LIST + SuggestionType.COMPLETER, type a prefix that matches completions, then type characters that eliminate all matches — verify the menu disappears

When AUTO_MENU_LIST and autosuggestion are enabled, the completion menu
stayed visible even after the user typed characters that eliminated all
matching candidates. The root cause was in clearChoices(), which called
doList() with an empty candidate list. Since doList() returns early at
the possibleSize == 0 check without clearing the post field, the stale
completion menu lambda remained set and continued to render the old
candidates on every redisplay.

Fix clearChoices() to directly set post = null instead of delegating to
doList(), which correctly removes the completion display when there are
no matching candidates.

Fixes #1338
@gnodet gnodet added this to the 4.0.0 milestone Feb 19, 2026
@gnodet gnodet added the bug label Feb 19, 2026
@gnodet gnodet merged commit 9c5bea1 into master Feb 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto suggestion list not closed when there are no matching completions

1 participant

Comments