summaryrefslogtreecommitdiff
path: root/helm-buffers.el
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2017-10-02 10:18:06 +0100
committerPierre Neidhardt <ambrevar@gmail.com>2017-10-02 10:18:06 +0100
commit7b852880cf05f10851cb2df24397d04bcf1471ae (patch)
treeb4e1ea27f8d34d098a4e6ff6db7d42c0de881e50 /helm-buffers.el
parent6f20c49b27efc9ed85ccf867a67d28463c05be9d (diff)
Refector some window- and buffer-related functions
Diffstat (limited to 'helm-buffers.el')
-rw-r--r--helm-buffers.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/helm-buffers.el b/helm-buffers.el
index b6d89a84..b34424d1 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -740,7 +740,7 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
"Run switch to other window action from `helm-source-buffers-list'."
(interactive)
(with-helm-alive-p
- (helm-exit-and-execute-action 'helm-display-buffers-other-windows)))
+ (helm-exit-and-execute-action 'helm-buffer-switch-buffers-other-window)))
(put 'helm-buffer-switch-other-window 'helm-only t)
(defun helm-buffer-switch-other-frame ()
@@ -750,6 +750,19 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(helm-exit-and-execute-action 'switch-to-buffer-other-frame)))
(put 'helm-buffer-switch-other-frame 'helm-only t)
+(defun helm-buffer-switch-buffers (_candidate)
+ "Switch to buffer candidates and replace current buffer.
+
+If more than one buffer marked switch to these buffers in separate windows.
+If a prefix arg is given split windows vertically."
+ (let ((buffers (helm-marked-candidates)))
+ (helm-window-show-buffers buffers)))
+
+(defun helm-buffer-switch-buffers-other-window (_candidate)
+ "Switch to buffer candidates in other windows."
+ (let ((buffers (helm-marked-candidates)))
+ (helm-window-show-buffers buffers t)))
+
(defun helm-buffer-run-ediff ()
"Run ediff action from `helm-source-buffers-list'."
(interactive)