1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-21 20:00:07 +00:00

Correct interpretation of boolean variables.

This commit is contained in:
Dominik Ritter 2015-03-31 01:30:20 +02:00
parent 7ff18e7716
commit c27513149a

View file

@ -52,7 +52,7 @@ autoload -Uz vcs_info
local VCS_WORKDIR_DIRTY=false local VCS_WORKDIR_DIRTY=false
local VCS_CHANGESET_PREFIX='' local VCS_CHANGESET_PREFIX=''
if [ $POWERLEVEL9K_SHOW_CHANGESET ]; then if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then
# Just display the first 12 characters of our changeset-ID. # Just display the first 12 characters of our changeset-ID.
VCS_CHANGESET_PREFIX="%F{$DEFAULT_COLOR_DARK}%12.12i@%f" VCS_CHANGESET_PREFIX="%F{$DEFAULT_COLOR_DARK}%12.12i@%f"
fi fi
@ -73,7 +73,7 @@ zstyle ':vcs_info:hg*:*' branchformat "%b"
# The `get-revision` function must be turned on for dirty-check to work for Hg # The `get-revision` function must be turned on for dirty-check to work for Hg
zstyle ':vcs_info:hg*:*' get-revision true zstyle ':vcs_info:hg*:*' get-revision true
if [ $POWERLEVEL9K_SHOW_CHANGESET ]; then if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then
zstyle ':vcs_info:*' get-revision true zstyle ':vcs_info:*' get-revision true
else else
# A little performance-boost for large repositories (especially Hg). If we # A little performance-boost for large repositories (especially Hg). If we
@ -144,7 +144,7 @@ prompt_vcs() {
local vcs_prompt="${vcs_info_msg_0_}" local vcs_prompt="${vcs_info_msg_0_}"
if [[ -n $vcs_prompt ]]; then if [[ -n $vcs_prompt ]]; then
if ( $VCS_WORKDIR_DIRTY ); then if [[ "$VCS_WORKDIR_DIRTY" == true ]]; then
$1_prompt_segment yellow $DEFAULT_COLOR $1_prompt_segment yellow $DEFAULT_COLOR
else else
$1_prompt_segment green $DEFAULT_COLOR $1_prompt_segment green $DEFAULT_COLOR
@ -296,7 +296,7 @@ prompt_aws() {
# Main prompt # Main prompt
build_left_prompt() { build_left_prompt() {
if (( ${#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS} == 0 )); then if [[ ${#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS} == 0 ]]; then
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
fi fi
@ -311,7 +311,7 @@ build_left_prompt() {
build_right_prompt() { build_right_prompt() {
RETVAL=$? RETVAL=$?
if (( ${#POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS} == 0 )); then if [[ ${#POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS} == 0 ]]; then
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(longstatus history time) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(longstatus history time)
fi fi
@ -328,7 +328,7 @@ precmd() {
vcs_info_hookadd set-message vcs-detect-changes vcs_info_hookadd set-message vcs-detect-changes
} }
if [ $POWERLEVEL9K_PROMPT_ON_NEWLINE ] ; then if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
PROMPT='╭─%{%f%b%k%}$(build_left_prompt) PROMPT='╭─%{%f%b%k%}$(build_left_prompt)
╰─ ' ╰─ '
else else