Browse code

Fix to random theme selection

- themes array is 1-based

- theme files names are located in indicies 1 through N inclusive

- this resolves an issue where you would occasionally see: "no such
file or directory. Random theme '' loaded..."

Casey Watson authored on 24/05/2011 at 18:15:58
Showing 1 changed files
... ...
@@ -31,7 +31,7 @@ if [ "$ZSH_THEME" = "random" ]
31 31
 then
32 32
   themes=($ZSH/themes/*zsh-theme)
33 33
   N=${#themes[@]}
34
-  ((N=RANDOM%N))
34
+  ((N=(RANDOM%N)+1))
35 35
   RANDOM_THEME=${themes[$N]}
36 36
   source "$RANDOM_THEME"
37 37
   echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."