fix group completion
Original code does not work if multile directories are matched
This commit is contained in:
parent
c03ee3f617
commit
6470db93fb
|
@ -78,11 +78,8 @@ _bundle_gems() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_bundle_groups() {
|
_bundle_groups() {
|
||||||
setopt extendedglob
|
if [[ -e Gemfile ]]; then
|
||||||
|
local -a groups=(${(@f)"$(awk '/^ *group *:/{sub(/^ *group *:/, ""); print $1}' Gemfile)"})
|
||||||
local gemdir=$(echo (../)#Gemfile(:h))
|
|
||||||
if [[ -n $gemdir ]]; then
|
|
||||||
local -a groups=($(cd "$gemdir" && awk '/^ *group *:/{sub(/^ *group *:/, ""); print $1}' Gemfile))
|
|
||||||
_values 'groups' $groups
|
_values 'groups' $groups
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue