mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix: Ignore .yaml and .py files when installing completions (#528)
Signed-off-by: Doster, Vladislav <mvdoster@gmail.com> Co-authored-by: vladislav doster <10052309+vladdoster@users.noreply.github.com>
This commit is contained in:
parent
5706971e90
commit
113cfc47fb
|
|
@ -51,5 +51,15 @@
|
|||
assert "$ZPLUGINS/test---completions-overwrite/_whatever2" is_file
|
||||
assert "$ZINIT[COMPLETIONS_DIR]/_whatever2" is_file
|
||||
}
|
||||
@test 'completions-ignored' {
|
||||
# only the _valid file should be installed as a completion
|
||||
run zinit as"null" id-as"test/ignored_completions" atclone"touch __init__.py _valid" completions for zdharma-continuum/null
|
||||
assert $state equals 0
|
||||
assert "$ZPLUGINS/test---ignored_completions/_valid" is_file
|
||||
assert "$ZPLUGINS/test---ignored_completions/__init__.py" is_file
|
||||
assert "$ZINIT[COMPLETIONS_DIR]/_valid" is_file
|
||||
COMPS=( "$ZINIT[COMPLETIONS_DIR]"/_* )
|
||||
assert __init__.py is_not_value_in $COMPS
|
||||
}
|
||||
|
||||
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=\ {,}:foldmethod=marker
|
||||
|
|
|
|||
|
|
@ -554,8 +554,8 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
local c cfile bkpfile
|
||||
# The plugin == . is a semi-hack/trick to handle 'creinstall .' properly
|
||||
[[ $user == % || ( -z $user && $plugin == . ) ]] && \
|
||||
completions=( "${plugin}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) ) || \
|
||||
completions=( "${ZINIT[PLUGINS_DIR]}/${id_as//\//---}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) )
|
||||
completions=( "${plugin}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.yaml|*.py|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) ) || \
|
||||
completions=( "${ZINIT[PLUGINS_DIR]}/${id_as//\//---}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.yaml|*.py|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) )
|
||||
already_symlinked=( "${ZINIT[COMPLETIONS_DIR]}"/_[^_.]*~*.zwc(DN) )
|
||||
backup_comps=( "${ZINIT[COMPLETIONS_DIR]}"/[^_.]*~*.zwc(DN) )
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue