Merge bef2035b69
into f8c41dbdbb
This commit is contained in:
commit
2382f9aeaa
21
src/_golang
21
src/_golang
|
@ -43,6 +43,18 @@
|
||||||
# * Go authors
|
# * Go authors
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
# Notes
|
||||||
|
# -----
|
||||||
|
#
|
||||||
|
# * To disable listing packages from GOROOT (i.e. Go stdlib) in completions use:
|
||||||
|
#
|
||||||
|
# zstyle ':completion:*:go:*' no-goroot true
|
||||||
|
#
|
||||||
|
# * To disable listing packages from GOPATH in completions use:
|
||||||
|
#
|
||||||
|
# zstyle ':completion:*:go:*' no-gopath true
|
||||||
|
#
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
__go_buildmodes() {
|
__go_buildmodes() {
|
||||||
local -a buildmodes=(
|
local -a buildmodes=(
|
||||||
|
@ -384,11 +396,16 @@ case $state in
|
||||||
__go_packages() {
|
__go_packages() {
|
||||||
local gopaths
|
local gopaths
|
||||||
declare -a gopaths
|
declare -a gopaths
|
||||||
gopaths=("${(s/:/)$(go env GOPATH)}")
|
if ! zstyle -t ":completion:${curcontext}:" no-gopath; then
|
||||||
gopaths+=("$(go env GOROOT)")
|
gopaths=("${(s/:/)$(go env GOPATH)}")
|
||||||
|
fi
|
||||||
|
if ! zstyle -t ":completion:${curcontext}:" no-goroot; then
|
||||||
|
gopaths+=("$(go env GOROOT)")
|
||||||
|
fi
|
||||||
for p in $gopaths; do
|
for p in $gopaths; do
|
||||||
_path_files $@ -W "$p/src" -/
|
_path_files $@ -W "$p/src" -/
|
||||||
done
|
done
|
||||||
|
|
||||||
# no special treatment for
|
# no special treatment for
|
||||||
# - relative paths starting with ..
|
# - relative paths starting with ..
|
||||||
# - absolute path starting with /
|
# - absolute path starting with /
|
||||||
|
|
Loading…
Reference in New Issue