From 3fb7fe04d5c981f58a4a08fb819374cc7b6fb99d 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 | 7 +++++-- readme.md | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index eed7e265..840207a9 100644 --- a/pure.zsh +++ b/pure.zsh @@ -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 @@ -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 diff --git a/readme.md b/readme.md index 35dc3d00..406041ee 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 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 ```