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 3fb7fe0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ 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.
# Git stash symbol (if opted in).
if [[ -n $prompt_pure_vcs_info[stash] ]]; then
preprompt_parts+=('%F{$prompt_pure_colors[git:stash]}${PURE_GIT_STASH_SYMBOL:-≡}%f')
fi
Expand Down Expand Up @@ -271,7 +271,10 @@ prompt_pure_async_vcs_info() {
# and stash information via misc (%m).
zstyle ':vcs_info:git*' formats '%b' '%R' '%a' '%m'
zstyle ':vcs_info:git*' actionformats '%b' '%R' '%a' '%m'
zstyle ':vcs_info:git*+set-message:*' hooks git-stash
zstyle -t ":prompt:pure:git:stash" show
if [[ $? == 0 ]]; then
zstyle ':vcs_info:git*+set-message:*' hooks git-stash
fi

vcs_info

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 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 3fb7fe0

Please sign in to comment.