Use tabs and use pacman-conf over config parsing

This makes our zsh completion more similar to pacmans. Making it easier
to view diffs between the two.
This commit is contained in:
morganamilo 2018-08-30 11:32:14 +01:00
parent 127c5e7cb9
commit 5996e28e32
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E

View file

@ -398,7 +398,7 @@ _pacman_completions_all_packages() {
typeset -U packages typeset -U packages
${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}" ${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}"
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options}) repositories=($(pacman-conf --repo-list))
typeset -U repositories typeset -U repositories
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories _wanted repo_packages expl "repository/package" compadd -S "/" $repositories
fi fi
@ -430,7 +430,7 @@ _pacman_all_packages() {
# provides completions for repository names # provides completions for repository names
_pacman_completions_repositories() { _pacman_completions_repositories() {
local -a cmd repositories local -a cmd repositories
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options}) repositories=($(pacman-conf --repo-list))
# Uniq the array # Uniq the array
typeset -U repositories typeset -U repositories
compadd "$@" -a repositories compadd "$@" -a repositories