mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
themes: add indirection to make "local" work in theme definitions
This commit is contained in:
parent
66d0b80d06
commit
ae27b672e9
1 changed files with 10 additions and 2 deletions
|
|
@ -70,8 +70,8 @@ function _omz_load_theme_from_file() {
|
||||||
values_before[$param]=${(P)param}
|
values_before[$param]=${(P)param}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Actually load the theme
|
# Actually load the theme, using an indirection function
|
||||||
source $file
|
_omz_source_theme_file $file
|
||||||
|
|
||||||
# Debugging stuff
|
# Debugging stuff
|
||||||
if [[ $ZSH_THEME_DEBUG == true ]]; then
|
if [[ $ZSH_THEME_DEBUG == true ]]; then
|
||||||
|
|
@ -128,6 +128,14 @@ function _omz_load_theme_from_file() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sources the given file
|
||||||
|
# The only reason this function exists is to provide a layer of
|
||||||
|
# indirection so that the theme file runs in its own function call stack frame
|
||||||
|
# and "local" statements in the theme definitions work as intended.
|
||||||
|
function _omz_source_theme_file() {
|
||||||
|
source $1
|
||||||
|
}
|
||||||
|
|
||||||
# Resets all theme settings to their default state
|
# Resets all theme settings to their default state
|
||||||
# (To the extent that we know what themes do, that is.)
|
# (To the extent that we know what themes do, that is.)
|
||||||
# This will reset all variables used by the core OMZ *_prompt_info functions.
|
# This will reset all variables used by the core OMZ *_prompt_info functions.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue