Explorar o código

Fix git prompt change limit not working for X set

weiyi %!s(int64=10) %!d(string=hai) anos
pai
achega
b81ee1edeb
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      zsh/custom/cinaeco.zsh-theme

+ 4 - 4
zsh/custom/cinaeco.zsh-theme

@@ -97,20 +97,20 @@ git_prompt_status() {
   local END=""
   local COUNT=0
   echo $INDEX | while IFS= read LINE; do
+    ((COUNT+=1))
+    ((COUNT >= 20)) && END="%{$reset_color%}..." && break
     X=$LINE[1]
     Y=$LINE[2]
     [[ $X$Y == '??' ]] && UN_SET="$UN_SET$ZSH_THEME_GIT_PROMPT_UNTRACKED" && continue
     [[ $X == 'U' ]] || [[ $Y == 'U' ]] && UN_SET="$UN_SET$ZSH_THEME_GIT_PROMPT_UNMERGED" && continue
     [[ $X$Y == 'DD' ]] || [[ $X$Y == 'AA' ]] && UN_SET="$UN_SET$ZSH_THEME_GIT_PROMPT_UNMERGED" && continue
-    [[ $Y == 'M' ]] && Y_SET="$Y_SET$ZSH_THEME_GIT_TREE_MODIFIED"
-    [[ $Y == 'D' ]] && Y_SET="$Y_SET$ZSH_THEME_GIT_TREE_DELETED"
+    [[ $Y == 'M' ]] && Y_SET="$Y_SET$ZSH_THEME_GIT_TREE_MODIFIED" && continue
+    [[ $Y == 'D' ]] && Y_SET="$Y_SET$ZSH_THEME_GIT_TREE_DELETED" && continue
     [[ $X == 'M' ]] && X_SET="$X_SET$ZSH_THEME_GIT_INDEX_MODIFIED" && continue
     [[ $X == 'A' ]] && X_SET="$X_SET$ZSH_THEME_GIT_INDEX_ADDED" && continue
     [[ $X == 'D' ]] && X_SET="$X_SET$ZSH_THEME_GIT_INDEX_DELETED" && continue
     [[ $X == 'R' ]] && X_SET="$X_SET$ZSH_THEME_GIT_INDEX_RENAMED" && continue
     [[ $X == 'C' ]] && X_SET="$X_SET$ZSH_THEME_GIT_INDEX_COPIED" && continue
-    ((COUNT+=1))
-    ((COUNT >= 20)) && END="%{$reset_color%}..." && break
   done
   local STATUS=" %{$FG[070]%}$X_SET%{$FG[124]%}$Y_SET%{$FG[220]%}$UN_SET$END"
   echo $STATUS