From e483d35e905c2e26fac63f33c77b9e764729a364 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sat, 28 Sep 2019 16:54:23 +0200 Subject: [PATCH] Check whether there's a prev/next window config to switch to Closes #111 --- eyebrowse.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eyebrowse.el b/eyebrowse.el index f80f591..889daf6 100644 --- a/eyebrowse.el +++ b/eyebrowse.el @@ -405,7 +405,7 @@ window config COUNT." (index (-elem-index match window-configs))) (if count (eyebrowse-switch-to-window-config count) - (when index + (when (and index (> (length window-configs) 1)) (if (< (1+ index) (length window-configs)) (eyebrowse-switch-to-window-config (car (nth (1+ index) window-configs))) @@ -427,7 +427,7 @@ switch COUNT window configs backwards and always wrap around." (eyebrowse-prev-window-config (when (> count 1) (eyebrowse-prev-window-config (1- count))))) - (when index + (when (and index (> (length window-configs) 1)) (if (> index 0) (eyebrowse-switch-to-window-config (car (nth (1- index) window-configs)))