fix(bash): aliases ordering

This commit is contained in:
ange 2024-07-02 14:44:21 +02:00
parent 2d8685c8e4
commit 6f8c736db7
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
4 changed files with 2 additions and 2 deletions

View File

@ -2,9 +2,9 @@ function _compalias() {
local name val valarr fn local name val valarr fn
name="${COMP_WORDS[0]}" name="${COMP_WORDS[0]}"
val="${BASH_ALIASES[$name]}" val="${BASH_ALIASES[$name]}"
[ -z "$val" ] && return 1
read -r -a valarr <<< "$val" [ -z "$val" ] && return 1
read -ra valarr <<< "$val"
COMP_WORDS=("${valarr[@]}" "${COMP_WORDS[@]:1}") COMP_WORDS=("${valarr[@]}" "${COMP_WORDS[@]:1}")
COMP_LINE="${COMP_LINE//$name/$val}" COMP_LINE="${COMP_LINE//$name/$val}"
COMP_CWORD="$((${#COMP_WORDS[@]} - 1))" COMP_CWORD="$((${#COMP_WORDS[@]} - 1))"