Skip to content

Commit

Permalink
Emit error if can't toggle window layout
Browse files Browse the repository at this point in the history
  • Loading branch information
bmag committed Nov 15, 2016
1 parent 5c9615f commit 0d4a8a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions layers/+distributions/spacemacs-base/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ windows."
(defun spacemacs/window-layout-toggle ()
"Toggle between horizontal and vertical layout of two windows."
(interactive)
(when (= (count-windows) 2)
(if (= (count-windows) 2)
(let* ((window-tree (car (window-tree)))
(current-split-vertical-p (car window-tree))
(first-window (nth 2 window-tree))
Expand All @@ -183,7 +183,8 @@ windows."
(delete-other-windows first-window)
;; `window-state-put' also re-selects the window if needed, so we don't
;; need to call `select-window'
(window-state-put second-window-state (funcall splitter)))))
(window-state-put second-window-state (funcall splitter)))
(error "Can't toggle window layout when the number of windows isn't two.")))

;; originally from magnars and modified by ffevotte for dedicated windows
;; support, it has quite diverged by now
Expand Down

0 comments on commit 0d4a8a4

Please sign in to comment.