35e1d2ea48
that removes the dumpfile if it's outdated, so it will get dumped again when the shell starts next time. We're not using comdump because wrapped ZLE widgets cannot or should not be identified by compdump when they have a different name than the original one. See https://github.com/zsh-users/zsh-syntax-highlighting/issues/851
18 lines
723 B
Plaintext
18 lines
723 B
Plaintext
_zimfw_build_init() {
|
|
local -r ztarget=${ZIM_HOME}/init.zsh
|
|
# Force update of init.zsh if it's older than .zimrc
|
|
if [[ ${ztarget} -ot <%= home %>/.zimrc ]]; then
|
|
command mv -f ${ztarget}{,.old} || return 1
|
|
fi
|
|
_zimfw_mv =(
|
|
print -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
|
|
print -R "zmodule() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
|
|
# Remove all prefixes from _zfpaths, _zfunctions and _zcmds
|
|
local -r zpre=$'*\0'
|
|
print -R 'typeset -g _zim_fpath=('${${_zfpaths#${~zpre}}:A}')'
|
|
if (( ${#_zfpaths} )) print 'fpath=(${_zim_fpath} ${fpath})'
|
|
if (( ${#_zfunctions} )) print -R 'autoload -Uz -- '${_zfunctions#${~zpre}}
|
|
print -R ${(F)_zcmds#${~zpre}}
|
|
) ${ztarget}
|
|
}
|