From 1c0e5e4753d9292f554f224278c6e09ec2778625 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 9 Jul 2013 16:28:16 +0200 Subject: [PATCH] zsh/rc: Fix display of Git stash count. --- zsh/rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zsh/rc b/zsh/rc index 48f12fc..096dfab 100644 --- 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 } -- 2.44.1