Skip to content

Commit

Permalink
Don't overwrite Autosuggest's default ignore list
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Jun 13, 2023
1 parent 2de1226 commit e327674
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Functions/Init/.autocomplete:__main__
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local -Pa older_than_a_week=( $logdir/*(Nmd+7) )
zf_rm -f -- $older_than_a_week[@]

typeset -g _autocomplete__log=${logdir}/${(%):-%D{%F}}.log
typeset -g _autocomplete__ps4=$'%D{%T.%.} %e:%N:%I\t%? %(1_,%_ ,)'
typeset -g _autocomplete__ps4=$'%D{%T.%.} %e\t%N\t%I\t%? %(1_,%_ ,)'

local -P zsh_cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}/zsh
[[ -d $zsh_cache_dir ]] ||
Expand All @@ -54,6 +54,10 @@ for mod in $_autocomplete__mods; do
done

add-zsh-hook precmd ${0}:precmd

# Make sure we always run before Autosuggest, so we don't overwrite its default ignore list.
typeset -gaU precmd_functions=( ${0}:precmd $precmd_functions )

${0}:precmd() {
# WORKAROUND: For hook functions in Zsh 5.8, $0 can be something else than the function name.
0=${(%):-%N}
Expand Down
2 changes: 2 additions & 0 deletions zsh-autocomplete.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/zsh
unsetopt listbeep

() {
zmodload -F zsh/parameter p:funcfiletrace
zmodload zsh/param/private
Expand Down

0 comments on commit e327674

Please sign in to comment.