Make abbreviation completions shadow commands

As reported in
https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$yD_Lutaftf6ytk617kjw5vC-k_OgHRQxIiSRv89uBMI
it's weird that command name completions shadow abbreviation name
completions, given that the abbreviation will the one that will be
executed in the typical cases. Let's put abbreviation completions first;
unique_completions_retaining_order() will take care of removing any command
completions we add later.
This commit is contained in:
Johannes Altmanninger
2025-03-03 19:52:12 +01:00
parent e015956de7
commit 852cb60ebd
3 changed files with 10 additions and 6 deletions

View File

@@ -629,3 +629,7 @@ complete -C'testcommand '
# CHECK: check{{\t}}Check the frobnicator
# CHECK: search{{\t}}Search for frobs
# CHECK: show{{\t}}Show all frobs
abbr cat cat
complete -C ca | string match -r '^cat(?:\t.*)?$'
# CHECK: cat{{\t}}Abbreviation: cat