Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
28232904
Unverified
Commit
28232904
authored
Aug 13, 2019
by
Marc Cornellà
Committed by
GitHub
Aug 13, 2019
Browse files
git-auto-fetch: override zle-line-init only if it exists
parent
49741437
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
View file @
28232904
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment