From 0a0f3d09c8b446a670455bdf29a5efaef4bd27fa Mon Sep 17 00:00:00 2001 From: Klaus Hartl Date: Sun, 1 Dec 2019 13:03:04 +0100 Subject: [PATCH] Adapt stash status to require opt-in via zstyle --- pure.zsh | 5 +++-- readme.md | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index eed7e265..31b205f4 100644 --- a/pure.zsh +++ b/pure.zsh @@ -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 diff --git a/readme.md b/readme.md index 35dc3d00..982465d2 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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 ```