Skip to content

Commit

Permalink
docs(_comp_delimited): elaborate on prefix addition considerations
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 22, 2023
1 parent e923e7f commit e3840d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,13 @@ _comp_delimited()
_comp_compgen COMPREPLY "$@" -- "${cur##*"$delimiter"}"
fi

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

0 comments on commit e3840d0

Please sign in to comment.