Skip to content

Commit

Permalink
Merge branch 'gregf-fix_whitespace'
Browse files Browse the repository at this point in the history
* gregf-fix_whitespace:
  Add new BULLETTRAIN_PROMPT_ADD_NEWLINE as a option
  Stop printing a blank line before every prompt
  • Loading branch information
caiogondim committed Oct 14, 2015
2 parents 20611a7 + c897e75 commit d790578
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|`BULLETTRAIN_PROMPT_CHAR`|`\$`|Character to be show before any command
|`BULLETTRAIN_PROMPT_ROOT`|`true`|Highlight if running as root
|`BULLETTRAIN_PROMPT_SEPARATE_LINE`|`true`|Make the prompt span across two lines
|`BULLETTRAIN_PROMPT_ADD_NEWLINE`|`true`|Adds a newline character before each prompt line


### Status

Expand Down
12 changes: 10 additions & 2 deletions bullet-train.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ fi
if [ ! -n "${BULLETTRAIN_PROMPT_SEPARATE_LINE+1}" ]; then
BULLETTRAIN_PROMPT_SEPARATE_LINE=true
fi
if [ ! -n "${BULLETTRAIN_PROMPT_ADD_NEWLINE+1}" ]; then
BULLETTRAIN_PROMPT_ADD_NEWLINE=true
fi

# STATUS
if [ ! -n "${BULLETTRAIN_STATUS_SHOW+1}" ]; then
Expand Down Expand Up @@ -498,10 +501,15 @@ build_prompt() {
prompt_end
}

if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] then
PROMPT='
if [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]]; then
if [[ $BULLETTRAIN_PROMPT_ADD_NEWLINE == true ]]; then
PROMPT='
%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
else
PROMPT='%{%f%b%k%}$(build_prompt)
%{${fg_bold[default]}%}$(prompt_char) %{$reset_color%}'
fi
else
PROMPT='%{%f%b%k%}$(build_prompt)%{${fg_bold[default]}%} $(prompt_char) %{$reset_color%}'
fi

0 comments on commit d790578

Please sign in to comment.