Prefix custom _complete implementation with "function" keyword

For some reason, when `_complete` is aliased before sourcing the plugin,
zsh was blowing up with a parse error. Adding "function" keyword makes
it parse successfully.

See similar issue: https://github.com/robbyrussell/oh-my-zsh/issues/6723#issuecomment-381220834

Fixes GitHub #442
This commit is contained in:
Eric Freese
2019-06-17 22:04:31 -06:00
parent 3654b83ec0
commit adb02c44a2
3 changed files with 19 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ _zsh_autosuggest_capture_completion_async() {
# https://stackoverflow.com/a/7057118/154703
autoload +X _complete
functions[_original_complete]=$functions[_complete]
_complete () {
function _complete() {
unset 'compstate[vared]'
_original_complete "$@"
}