Skip to content

Commit

Permalink
Fix regression introduced by 8bae95
Browse files Browse the repository at this point in the history
Mentioned in issue #187.
  • Loading branch information
marlonrichert committed Jun 7, 2021
1 parent dca535c commit 33e193b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions module/.autocomplete.__init__
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ local zsh_cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/zsh


local mod; for mod in compinit config widget key key-binding recent-dirs async; do
if ! zstyle -t ':autocomplete:' $mod false no off 0; then
mod=.autocomplete.$mod
$mod
unfunction $mod
builtin autoload -Uz ${${(%):-%x/$mod}:a}
if zstyle -T ':autocomplete:' $mod; then
source ~zsh-autocomplete/module/.autocomplete.$mod
fi
done

add-zsh-hook precmd .autocomplete.__init__.precmd
unfunction .autocomplete.__init__
2 changes: 1 addition & 1 deletion module/.autocomplete.key-binding
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ zmodload -Fa zsh/parameter p:funcstack p:functions
.autocomplete.key-binding.precmd() {
# Work around plugin managers making `key` local.
[[ -z $key[Tab] || -z $key[Shift-Tab] ]] &&
.autocomplete.key
source ~zsh-autocomplete/module/.autocomplete.key

local tab_style; zstyle -s :autocomplete:tab: widget-style tab_style ||
tab_style='complete-word'
Expand Down
10 changes: 2 additions & 8 deletions zsh-autocomplete.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ setopt NO_singlelinezle
hash -d zsh-autocomplete=$basedir
typeset -gU FPATH fpath=( ~zsh-autocomplete/completion $fpath[@] )

local -a subdirs=( ~zsh-autocomplete/*(N-/) )
if ! (( $#subdirs )); then
print -u2 -- 'zsh-autocomplete: Failed to find sub dirs. Aborting.'
return 66
fi

local -a funcs=( $^subdirs/.autocomplete.*~*.zwc(N-.:a) )
local -a funcs=( ~zsh-autocomplete/{utility,widget}/.autocomplete.*~*.zwc(N-.:a) )
if ! (( $#funcs )); then
print -u2 -- 'zsh-autocomplete: Failed to find functions. Aborting.'
return 66
fi
builtin autoload -Uz $funcs[@]

.autocomplete.__init__
source ~zsh-autocomplete/module/.autocomplete.__init__

# Workaround for https://github.com/zdharma/zinit/issues/366
[[ -v functions[.zinit-shade-on] ]] &&
Expand Down

0 comments on commit 33e193b

Please sign in to comment.