Unverified Commit 28232904 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

git-auto-fetch: override zle-line-init only if it exists

parent 49741437
......@@ -18,10 +18,18 @@ function git-auto-fetch {
echo "${fg_bold[red]}disabled${reset_color}")
}
eval "override-git-auto-fetch-$(declare -f zle-line-init)"
function zle-line-init () {
git-fetch-all
override-git-auto-fetch-zle-line-init
}
# Override zle-line-init if it exists
if (( $+functions[zle-line-init] )); then
eval "override-git-auto-fetch-$(declare -f zle-line-init)"
function zle-line-init () {
git-fetch-all
override-git-auto-fetch-zle-line-init
}
else
function zle-line-init () {
git-fetch-all
}
fi
zle -N zle-line-init
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment