1
0
Fork 0
mirror of synced 2024-06-01 23:01:11 -04:00
zimfw/src/templates/login_init.zsh.erb
Eric Nielsen a5fb148ccf
Force local zsh emulation options
so the code is not broken by unexpected option changes, like

    setopt RC_EXPAND_PARAM

which breaks

    print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'

in the _zimfw_build_init function, for example.

See #444.
2021-11-21 14:39:20 -05:00

25 lines
658 B
Plaintext

() {
builtin emulate -L zsh
setopt EXTENDED_GLOB
autoload -Uz zrecompile
local zdumpfile zfile
# Compile the completion cache; significant speedup
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump
if [[ -f ${zdumpfile} ]]; then
zrecompile -p ${1} ${zdumpfile} || return 1
fi
# Compile Zsh startup files
for zfile in <%= home %>/<%= startup_files_glob %>(N-.); do
zrecompile -p ${1} ${zfile} || return 1
done
# Compile Zim scripts
for zfile in #{zscriptglob}; do
zrecompile -p ${1} ${zfile} || return 1
done
if [[ ${1} != -q ]] print -P '<%= done %>Done with compile.'
} "${@}"