Checking if _zsh_highlight exists before calling it

This commit is contained in:
Arnaud Venturi 2017-07-21 21:30:26 +10:00
parent 3093396a51
commit f3bb215c76
2 changed files with 10 additions and 2 deletions

View File

@ -135,7 +135,11 @@ _zsh_autosuggest_accept() {
fi fi
_zsh_autosuggest_invoke_original_widget $@ _zsh_autosuggest_invoke_original_widget $@
_zsh_highlight
# If zsh-syntax-highlighting is installed, we need to refresh the highlighting here
if [ `whence _zsh_highlight` ]; then
_zsh_highlight
fi
} }
# Accept the entire suggestion and execute it # Accept the entire suggestion and execute it

View File

@ -400,7 +400,11 @@ _zsh_autosuggest_accept() {
fi fi
_zsh_autosuggest_invoke_original_widget $@ _zsh_autosuggest_invoke_original_widget $@
_zsh_highlight
# If zsh-syntax-highlighting is installed, we need to refresh the highlighting here
if [ `whence _zsh_highlight` ]; then
_zsh_highlight
fi
} }
# Accept the entire suggestion and execute it # Accept the entire suggestion and execute it