From 8379c2f7afd35516c56bf91063528284846f13b5 Mon Sep 17 00:00:00 2001 From: Muneeb Shaikh Date: Mon, 26 Oct 2015 05:12:21 +0530 Subject: [PATCH] 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. --- core/core-themes-support.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/core-themes-support.el b/core/core-themes-support.el index 26b1172dd..7f041f197 100644 --- a/core/core-themes-support.el +++ b/core/core-themes-support.el @@ -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))