Skip to content

Commit

Permalink
Adapt stash status to require opt-in via zstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Dec 1, 2019
1 parent 2e45abe commit 0a0f3d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ prompt_pure_preprompt_render() {
if [[ -n $prompt_pure_git_arrows ]]; then
preprompt_parts+=('%F{$prompt_pure_colors[git:arrow]}${prompt_pure_git_arrows}%f')
fi
# Git stash symbol.
if [[ -n $prompt_pure_vcs_info[stash] ]]; then
# Git stash symbol (if opted in).
zstyle -t ":prompt:pure:git:stash:show" enable
if [[ -n $prompt_pure_vcs_info[stash] && $? == 0 ]]; then
preprompt_parts+=('%F{$prompt_pure_colors[git:stash]}${PURE_GIT_STASH_SYMBOL:-≡}%f')
fi

Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ prompt pure
| **`PURE_GIT_UP_ARROW`** | Defines the git up arrow symbol. | `` |
| **`PURE_GIT_STASH_SYMBOL`** | Defines the git stash symbol. | `` |

Showing git stash status as part of the prompt is not activated by default. To activate this you'll need to opt in via `zstyle`:

`zstyle ':prompt:pure:git:stash:show' enable yes`

## Colors

Expand Down Expand Up @@ -144,6 +147,9 @@ zstyle :prompt:pure:path color white
# change the color for both `prompt:success` and `prompt:error`
zstyle ':prompt:pure:prompt:*' color cyan

# turn on git stash status
zstyle ':prompt:pure:git:stash:show' enable yes

prompt pure
```

Expand Down

0 comments on commit 0a0f3d0

Please sign in to comment.