aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2018-04-14 04:58:10 +0300
committerGitHub <noreply@github.com>2018-04-14 04:58:10 +0300
commit7234d52ebd76b6b89e172ac5b19339f0a37ab596 (patch)
treefe44bd89e703f0d1ee939722efa92543bb281b31 /powerlevel9k.zsh-theme
parent4c919f1a2bca9d52271edebcbd5090423304afef (diff)
parentf066dc1cf71b9fe595a4b162853c28d486513c08 (diff)
Merge pull request #791 from dritter/local_variables
Make variables local
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme8
1 files changed, 5 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8379f68a..8f06866f 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -278,7 +278,7 @@ CURRENT_BG='NONE'
prompt_anaconda() {
# Depending on the conda version, either might be set. This
# variant works even if both are set.
- _path=$CONDA_ENV_PATH$CONDA_PREFIX
+ local _path=$CONDA_ENV_PATH$CONDA_PREFIX
if ! [ -z "$_path" ]; then
# config - can be overwritten in users' zshrc file.
set_default POWERLEVEL9K_ANACONDA_LEFT_DELIMITER "("
@@ -921,7 +921,7 @@ prompt_dir() {
fi
# declare variables used for bold and state colors
- local bld dir_state_foreground dir_state_user_foreground
+ local bld_on bld_off dir_state_foreground dir_state_user_foreground
# test if user wants the last directory printed in bold
if [[ "${(L)POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD}" == "true" ]]; then
bld_on="%B"
@@ -1685,6 +1685,7 @@ build_left_prompt() {
# Right prompt
build_right_prompt() {
local index=1
+ local element
for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do
# Remove joined information in direct calls
element=${element%_joined}
@@ -1707,6 +1708,7 @@ powerlevel9k_preexec() {
set_default POWERLEVEL9K_PROMPT_ADD_NEWLINE false
powerlevel9k_prepare_prompts() {
+ local RETVAL RPROMPT_PREFIX RPROMPT_SUFFIX
RETVAL=$?
RETVALS=( "$pipestatus[@]" )
@@ -1741,7 +1743,7 @@ $(print_icon 'MULTILINE_LAST_PROMPT_PREFIX')'
RPROMPT='$RPROMPT_PREFIX%f%b%k$(build_right_prompt)%{$reset_color%}$RPROMPT_SUFFIX'
fi
-NEWLINE='
+local NEWLINE='
'
if [[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]]; then