Fixes #1217, SPC T n after SPC T h broken

If we select a theme after spacemacs' startup, then
`spacemacs--cycle-themes` doesn't have the first theme from
`dotspacemacs-themes` so we start over.
This commit is contained in:
Muneeb Shaikh 2015-10-26 05:12:21 +05:30 committed by Eivind Fonn
parent c3299f0eca
commit 8379c2f7af
1 changed files with 5 additions and 2 deletions

View File

@ -193,8 +193,11 @@ package name does not match theme name + `-theme' suffix.")
(interactive)
(when spacemacs--cur-theme
(disable-theme spacemacs--cur-theme)
(setq spacemacs--cycle-themes
(append spacemacs--cycle-themes (list spacemacs--cur-theme))))
;; if current theme isn't in cycleable themes, start over
(if (not (member spacemacs--cur-theme dotspacemacs-themes))
(setq spacemacs--cycle-themes dotspacemacs-themes)
(setq spacemacs--cycle-themes
(append spacemacs--cycle-themes (list spacemacs--cur-theme)))))
(setq spacemacs--cur-theme (pop spacemacs--cycle-themes))
(message "Loading theme %s..." spacemacs--cur-theme)
(spacemacs/load-theme spacemacs--cur-theme))