summaryrefslogtreecommitdiff
path: root/config/p10k-lean.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-06-08 12:47:19 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-06-08 12:47:19 +0300
commit4ba3c010f6fa66dcf7d785251c80c416454b6e90 (patch)
tree259b3b075fcb7c969785803897936bea9fb37d2a /config/p10k-lean.zsh
parentb9c62ca02827c828fb544033950232e5426930ad (diff)
display "wip" in git status if the latest commit's summary contains "wip" or "WIP" (#1425)
Diffstat (limited to 'config/p10k-lean.zsh')
-rw-r--r--config/p10k-lean.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index f843f99a..aac1cc81 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -341,7 +341,7 @@
# Formatter for Git status.
#
- # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
+ # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
@@ -407,6 +407,11 @@
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
fi
+ # Display "wip" if the latest commit's summary contains "wip" or "WIP".
+ if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
+ res+=" ${modified}wip"
+ fi
+
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.