mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-22 00:21:27 +01:00
moved to Completion/Base/Utility/_store_cache
This commit is contained in:
parent
63a8ab3ca8
commit
7df6561d50
1 changed files with 0 additions and 36 deletions
|
@ -1,36 +0,0 @@
|
|||
#autoload
|
||||
#
|
||||
# Storage component of completions caching layer
|
||||
|
||||
local _cache_ident
|
||||
_cache_ident="$1"
|
||||
|
||||
if zstyle -t ":completion:${curcontext}:" use-cache; then
|
||||
# Decide which directory to cache to, and ensure it exists
|
||||
zstyle -s ":completion:${curcontext}:" cache-path _cache_dir
|
||||
: ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache}
|
||||
if [[ ! -d "$_cache_dir" ]]; then
|
||||
if [[ -e "$_cache_dir" ]]; then
|
||||
_message "cache-dir style points to a non-directory\!"
|
||||
else
|
||||
mkdir -p "$_cache_dir"
|
||||
if [[ ! -d "$_cache_dir" ]]; then
|
||||
_message "Couldn't create cache-dir $_cache_dir"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
shift
|
||||
for var; do
|
||||
case ${(Pt)var} in
|
||||
(*readonly*) ;;
|
||||
(*(association|array)*) print -r "$var=( ${(kv@Pqq)^^var} )";;
|
||||
(*) print -r "$var=${(Pqq)^^var}";;
|
||||
esac
|
||||
done >! "$_cache_dir/$_cache_ident"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
Loading…
Reference in a new issue