Only consider matching completions for formatting

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
This commit is contained in:
Marc Khouzam 2021-02-17 20:57:45 -05:00
parent 98cc4b0c79
commit 6d86d9185a

View file

@ -154,6 +154,8 @@ __%[1]s_handle_standard_completion_case() {
while IFS='' read -r comp; do
# Strip any description before checking the length
comp=${comp%%%%$tab*}
# Only consider the completions that match
comp=$(compgen -W "$comp" -- "$cur")
if ((${#comp}>longest)); then
longest=${#comp}
fi