26151d2f54
and replace the foreground color and bold expansions by ANSI escape codes. This should make the print calls now safe and no expansion at all should happen as we're using `-R` -- unless the `-e` flag is given. Fixes #521. Closes #522
21 lines
731 B
Plaintext
21 lines
731 B
Plaintext
_zimfw_source_zimrc() {
|
|
local -r ztarget=${ZIM_CONFIG_FILE:-<%= home %>/.zimrc} _zflags=${1}
|
|
local -i _zfailed=0
|
|
if ! source ${ztarget} || (( _zfailed )); then
|
|
print -u2 -R $'<%= red %>Failed to source <%= bold %>'${ztarget}$'<%= normal %>'
|
|
return 1
|
|
fi
|
|
if (( _zflags & 1 && ${#_znames} == 0 )); then
|
|
print -u2 -R $'<%= red %>No modules defined in <%= bold %>'${ztarget}$'<%= normal %>'
|
|
return 1
|
|
fi
|
|
# Remove all from _zfpaths, _zfunctions and _zcmds with disabled root dirs prefixes
|
|
local zroot_dir zpre
|
|
for zroot_dir in ${_zdisabled_root_dirs}; do
|
|
zpre=${zroot_dir}$'\0'
|
|
_zfpaths=(${_zfpaths:#${zpre}*})
|
|
_zfunctions=(${_zfunctions:#${zpre}*})
|
|
_zcmds=(${_zcmds:#${zpre}*})
|
|
done
|
|
}
|