aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-05-23 01:15:25 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-05-23 01:15:25 +0300
commit6cca2c339ebbf66428dc8ae90da1fec573f18fb1 (patch)
tree2ab042ad94a43a52d7d180e444b42d4584845d75
parent3aba9e20e5aacdceb018451c82848395e39ca65c (diff)
Code documentation.
-rw-r--r--powerlevel9k.zsh-theme5
1 files changed, 5 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8ca0263e..7ad3e49f 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -144,6 +144,11 @@ left_prompt_segment() {
# local BG_COLOR_MODIFIER=${(P)POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND}
# Overwrite given background-color by user defined variable for this segment.
+ # We get as first Parameter the function name, which called this function.
+ # From the given function name, we strip the "prompt_"-prefix and uppercase it.
+ # This is, prefixed with "POWERLEVEL9K_" and suffixed with either "_BACKGROUND"
+ # of "_FOREGROUND", our variable name. So each new Segment should automatically
+ # be overwritable by a variable following this naming convention.
local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND
local BG_COLOR_MODIFIER=${(P)BACKGROUND_USER_VARIABLE}
[[ -n $BG_COLOR_MODIFIER ]] && 2=$BG_COLOR_MODIFIER