Reflect submodule status in VCS prompty by default.

pull/22/head
Ben Hilburn 9 years ago
parent 5af484bd6d
commit 94c87a4d23

@ -289,6 +289,7 @@ customization is provided via:
|`POWERLEVEL9K_HIDE_BRANCH_ICON`|`false`|Set to `true` to hide the branch icon from the segment.| |`POWERLEVEL9K_HIDE_BRANCH_ICON`|`false`|Set to `true` to hide the branch icon from the segment.|
|`POWERLEVEL9K_SHOW_CHANGESET`|`false`|Set to `true` to display the hash / changeset in the segment.| |`POWERLEVEL9K_SHOW_CHANGESET`|`false`|Set to `true` to display the hash / changeset in the segment.|
|`POWERLEVEL9K_CHANGESET_HASH_LENGTH`|`12`|How many characters of the hash / changeset to display in the segment.| |`POWERLEVEL9K_CHANGESET_HASH_LENGTH`|`12`|How many characters of the hash / changeset to display in the segment.|
|`POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY`|`true`|Set to `false` to not reflect submodule status in the top-level repository prompt.|
**vcs Symbols** **vcs Symbols**

@ -6,13 +6,18 @@
# https://github.com/bhilburn/powerlevel9k # https://github.com/bhilburn/powerlevel9k
################################################################ ################################################################
set_default POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY true
function +vi-git-untracked() { function +vi-git-untracked() {
# TODO: check git >= 1.7.2 - see function git_compare_version()
local FLAGS local FLAGS
FLAGS=('--porcelain') FLAGS=('--porcelain')
# TODO: check git >= 1.7.2 - see function git_compare_version()
FLAGS+='--ignore-submodules=dirty' if [[ "$POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY" == "false" ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \
-n $(git status ${FLAGS} | grep '^??' 2> /dev/null | tail -n1) ]]; then -n $(git status ${FLAGS} | grep -E '^??' 2> /dev/null | tail -n1) ]]; then
hook_com[unstaged]+=" %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_UNTRACKED_ICON')%f" hook_com[unstaged]+=" %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_UNTRACKED_ICON')%f"
VCS_WORKDIR_HALF_DIRTY=true VCS_WORKDIR_HALF_DIRTY=true
else else

Loading…
Cancel
Save