Fix spacemacs/kill-other-buffers to kill only buffers in the persp

This commit is contained in:
Seong Yong-ju 2019-11-16 00:59:08 +09:00 committed by duianto
parent 2e7a5c5929
commit 777d685c46
2 changed files with 6 additions and 1 deletions

View File

@ -117,6 +117,8 @@ the [[file:CHANGELOG.org][CHANGELOG.org]] file.
- ~SPC q z~ is now ~SPC q f~ to kill a frame.
- Remove ~SPC T N~ and make ~SPC T n~ cycle and start the theme transient
state (thanks to Sylvain Benner)
- Restricted ~SPC b C-d~ to only kill other buffers in current perspective
(thanks to Seong Yong-ju)
- Other:
- Support for multiple cursors using =evil-mc= is now encapsulated in the
=multiple-cursors= layer (thanks to Codruț Constantin Gușoi)

View File

@ -567,7 +567,10 @@ If the universal prefix argument is used then will the windows too."
(interactive "P")
(when (yes-or-no-p (format "Killing all buffers except \"%s\"? "
(buffer-name)))
(mapc 'kill-buffer (delq (current-buffer) (buffer-list)))
(let* ((buffers-to-kill (if (bound-and-true-p persp-mode)
(persp-buffer-list)
(buffer-list))))
(mapc 'kill-buffer (delq (current-buffer) buffers-to-kill)))
(when (equal '(4) arg) (delete-other-windows))
(message "Buffers deleted!")))