Check whether there's a prev/next window config to switch to

Closes #111
This commit is contained in:
Vasilij Schneidermann
2019-09-28 16:54:23 +02:00
parent e0f6bdf3fc
commit e483d35e90

View File

@ -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)))