Skip to content

Honor ignore_case when routing nested completions - #2120

Open
FanWu-ai wants to merge 1 commit into
prompt-toolkit:mainfrom
FanWu-ai:fix-nested-completer-ignore-case
Open

FanWu-ai wants to merge 1 commit into
prompt-toolkit:mainfrom
FanWu-ai:fix-nested-completer-ignore-case

Conversation

@FanWu-ai

@FanWu-ai FanWu-ai commented Oct 4, 2026

Copy link
Copy Markdown

NestedCompleter(ignore_case=True) matches S to show, but drops nested suggestions for SHOW . Use the same lowercase comparison when routing a completed command, while preserving exact-key priority, terminal None entries and original cursor offsets.

Adds regressions for mixed-case names, nested commands, collisions, mutable options and Unicode token lengths.

Validation:

  • 173 tests passed on Python 3.12 and 3.13.
  • The unchanged implementation fails 10 new regression cases; three real prompt/Tab-completion cases also fail before and pass after.
  • Ruff, typos, all pre-commit hooks, strict mypy for Linux/Windows/macOS, and wheel/sdist builds passed.

OpenAI Codex assisted with investigation, implementation, testing, independent review and this description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant