summaryrefslogtreecommitdiff
path: root/helm-utils.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-09-18 08:34:29 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-09-18 08:34:29 +0200
commit6d393eb278c881ec40462b8f3227f1396c234618 (patch)
tree6a3180e41feabb928d8d271e4480776f5851d496 /helm-utils.el
parentcd5a032a0dbc658fc51e2e56b70d202465d43890 (diff)
Don't fail when there is too much windows
when displaying several buffers simulteanously. * helm-utils.el (helm-switch-to-buffers): Do it.
Diffstat (limited to 'helm-utils.el')
-rw-r--r--helm-utils.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/helm-utils.el b/helm-utils.el
index 7e850133..90495903 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -224,18 +224,20 @@ If more than one buffer marked switch to these buffers in separate windows.
If OTHER-WINDOW is specified keep current-buffer and switch to others buffers
in separate windows.
If a prefix arg is given split windows vertically."
- (let* ((mkds (helm-marked-candidates))
- (size (/ (window-height) (length mkds))))
- (or (<= window-min-height size)
- (error "Too many buffers to visit simultaneously."))
+ (let ((mkds (helm-marked-candidates)))
(helm-aif (cdr mkds)
(progn
(if other-window
(helm-switch-to-buffer-other-window (car mkds))
(switch-to-buffer (car mkds)))
(save-selected-window
- (cl-loop for b in it
- do (helm-switch-to-buffer-other-window b 'balance))))
+ (cl-loop with nosplit
+ for b in it
+ when nosplit return
+ (message "Too many buffers to visit simultaneously")
+ do (condition-case _err
+ (helm-switch-to-buffer-other-window b 'balance)
+ (error (setq nosplit t) nil)))))
(if other-window
(helm-switch-to-buffer-other-window buffer-or-name)
(switch-to-buffer buffer-or-name)))))