From 3b7dfff7ea5ccb00a9422b2713dffa4fd1d90358 Mon Sep 17 00:00:00 2001 From: theminor Date: Tue, 26 Jan 2016 17:20:20 -0500 Subject: [PATCH 1/3] Add VCS_WORKDIR_HALF_DIRTY vrbl for unstaged files --- functions/vcs.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index 4a0a7ead..b23b8330 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -10,6 +10,9 @@ function +vi-git-untracked() { if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ -n $(git ls-files --others --exclude-standard | sed q) ]]; then hook_com[unstaged]+=" %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_UNTRACKED_ICON')%f" + VCS_WORKDIR_HALF_DIRTY=true + else + VCS_WORKDIR_HALF_DIRTY=false fi } @@ -90,4 +93,3 @@ function +vi-vcs-detect-changes() { VCS_WORKDIR_DIRTY=false fi } - From d7c26513c8b2c45cbd95fda4d3289e33ffaf8369 Mon Sep 17 00:00:00 2001 From: John Minor Date: Wed, 27 Jan 2016 22:52:48 +0000 Subject: [PATCH 2/3] Add "_UNTRACKED" option for _VCS to change colors - default yellow --- powerlevel9k.zsh-theme | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 6f34b94c..d0da52a8 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -730,6 +730,8 @@ prompt_vcs() { autoload -Uz vcs_info VCS_WORKDIR_DIRTY=false + VCS_WORKDIR_HALF_DIRTY=false + VCS_CHANGESET_PREFIX='' if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then # Default: Just display the first 12 characters of our changeset-ID. @@ -774,9 +776,13 @@ prompt_vcs() { if [[ "$VCS_WORKDIR_DIRTY" == true ]]; then # $vcs_visual_identifier gets set in +vi-vcs-detect-changes in functions/vcs.zsh, # as we have there access to vcs_info internal hooks. - "$1_prompt_segment" "$0_MODIFIED" "$2" "yellow" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" + "$1_prompt_segment" "$0_MODIFIED" "$2" "red" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" else - "$1_prompt_segment" "$0" "$2" "green" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" + if [[ "$VCS_WORKDIR_HALF_DIRTY" == true ]]; then + "$1_prompt_segment" "$0_UNTRACKED" "$2" "yellow" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" + else + "$1_prompt_segment" "$0" "$2" "green" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" + fi fi fi } From 177bfc96021d101ff0caa4a1ac55d8fb0f117ba7 Mon Sep 17 00:00:00 2001 From: John Minor Date: Sun, 31 Jan 2016 10:08:09 +0000 Subject: [PATCH 3/3] update CHANGELOG re new UNTRACKED state in vcs segment --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 816a0dc0..7075219d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## v0.3.2 + +### `vcs` changes + +A new state `UNTRACKED` was added to the `vcs` segment. So we now +have 3 states for repositories: `UNTRACKED`, `MODIFIED`, and the +default state. The `UNTRACKED` state is active when there are files +in the repository directory which have not been added to the repo +(the same as when the `+` icon appears). The default color for the +`UNTRACKED` state is now yellow, and the default color for the +`MODIFIED` state is now read, but those colors can be changed by +setting these variables, for example: +```zsh +POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='black' +POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='white' +POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='green' +POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='blue' +``` + ## v0.3.1 ### `dir` changes