diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-09-16 19:15:50 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-09-16 21:12:28 +0200 |
commit | 1540070aabcbfb552318c596a63c89055ce111e9 (patch) | |
tree | d1abe34965252eca916cbd21a542ad02aa8f9f01 /helm-utils.el | |
parent | 2f167383c624c0063b11c4b2c08bfcdbb3c8a158 (diff) |
Add new function and use it
* helm-files.el (helm-find-files-other-window): Do it.
* helm-utils.el (helm-switch-to-buffers): Do it.
(helm-switch-to-buffer-other-window): New fn to avoid repeating myself.
Diffstat (limited to 'helm-utils.el')
-rw-r--r-- | helm-utils.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/helm-utils.el b/helm-utils.el index a7059e12..a7eddd91 100644 --- a/helm-utils.el +++ b/helm-utils.el @@ -235,18 +235,17 @@ If a prefix arg is given split windows vertically." (switch-to-buffer (car mkds))) (save-selected-window (cl-loop for b in it - do (progn - (select-window (split-window - nil nil helm-current-prefix-arg)) - (balance-windows) - (switch-to-buffer b))))) + do (helm--switch-to-buffer-other-window b 'balance)))) (if other-window - (progn - (select-window (split-window - nil nil helm-current-prefix-arg)) - (switch-to-buffer buffer-or-name)) + (helm--switch-to-buffer-other-window buffer-or-name) (switch-to-buffer buffer-or-name))))) +(defun helm--switch-to-buffer-other-window (buffer-or-name &optional balance) + (select-window (split-window + nil nil helm-current-prefix-arg)) + (and balance (balance-windows)) + (switch-to-buffer buffer-or-name)) + (defun helm-switch-to-buffers-other-window (buffer-or-name) "switch to buffer BUFFER-OR-NAME in other window. See `helm-switch-to-buffers' for switching to marked buffers." |