new-empty-buffer: force buffer to appear in new window

Pass non-nil force-same-window argument to switch-to-buffer, so the newly
generated buffer is guaranteed to display in the newly created window.
This commit is contained in:
bmag 2017-04-18 22:10:33 +03:00
parent b769756f6d
commit 4b92183cc0
1 changed files with 3 additions and 1 deletions

View File

@ -504,7 +504,9 @@ buffer in a split window."
('below (spacemacs/split-window-vertically-and-switch))
('above (split-window-vertically))
('right (spacemacs/split-window-horizontally-and-switch)))
(switch-to-buffer newbuf)))
;; pass non-nil force-same-window to prevent `switch-to-buffer' from
;; displaying buffer in another window
(switch-to-buffer newbuf nil 'force-same-window)))
(defun spacemacs/new-empty-buffer-left ()
"Create a new buffer called untitled(<n>),