]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Fix display of Git stash count.
authorSimon Ruderich <simon@ruderich.org>
Tue, 9 Jul 2013 14:28:16 +0000 (16:28 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 9 Jul 2013 14:28:37 +0000 (16:28 +0200)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 48f12fc4b0b0b70fc7866d03d6c1f4661889d0ed..096dfabb326a5f80d73e1e429b429216cf6cd2b2 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -1,6 +1,6 @@
 # Zsh configuration file.
 
-# Copyright (C) 2011-2012  Simon Ruderich
+# Copyright (C) 2011-2013  Simon Ruderich
 #
 # This file is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -297,10 +297,10 @@ if [[ $ZSH_VERSION == (4.3.<9->*|4.<4->*|<5->*) ||
             local -a stashes
             # Thanks to Valodim in #zsh on Freenode (2013-07-01 14:14 CEST)
             # for the solution to "grep" the output with (M) and :#(...).
-            stashes=${#${(M)${(f)"$(git stash list 2>/dev/null)"}:#(*WIP*)}}
+            stashes=( ${(M)${(f)"$(git stash list 2>/dev/null)"}:#(*WIP*)} )
 
-            if [[ $stashes -gt 0 ]]; then
-                hook_com[misc]+=" ${yellow}${stashes}s${default}"
+            if [[ ${#stashes} -gt 0 ]]; then
+                hook_com[misc]+=" ${yellow}${#stashes}s${default}"
             fi
         fi
     }