# 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
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
}