Skip to content

Commit e3840d0

Browse files
committed
docs(_comp_delimited): elaborate on prefix addition considerations
1 parent e923e7f commit e3840d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bash_completion

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,13 @@ _comp_delimited()
895895
_comp_compgen COMPREPLY "$@" -- "${cur##*"$delimiter"}"
896896
fi
897897

898+
# It would seem that in some specific cases we could avoid adding the
899+
# prefix to all completions, thereby making the list of suggestions
900+
# cleaner, and only adding it when there's exactly one completion.
901+
# The cases where this opportunity has been observed involve having
902+
# `show-all-if-ambiguous` on, but even that has cases where it fails
903+
# and the last separator including everything before it is lost.
904+
# https://github.com/scop/bash-completion/pull/913#issuecomment-1490140309
898905
local i
899906
for i in "${!COMPREPLY[@]}"; do
900907
COMPREPLY[i]="$prefix${COMPREPLY[i]}"

0 commit comments

Comments
 (0)