[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 2e497eed19 3/4: Display action buffer below helm-wind
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 2e497eed19 3/4: Display action buffer below helm-window (#2635) |
Date: |
Wed, 17 Jan 2024 07:00:15 -0500 (EST) |
branch: elpa/helm
commit 2e497eed192687296faff7f9bf7d193f076dd3e3
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Display action buffer below helm-window (#2635)
when helm-show-action-window-other-window is left or right and window
is smaller that split-width-threshold (use 160, its default value when
set to nil).
---
helm-core.el | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/helm-core.el b/helm-core.el
index f97ddb31d3..5fd4e313ba 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -5565,10 +5565,14 @@ Coerce source with coerce function."
action))
(defun helm--show-action-window-other-window-p ()
- (and helm-show-action-window-other-window
- (or helm-always-two-windows
- helm--buffer-in-new-frame-p)
- (eq helm-split-window-state 'vertical)))
+ (when (and helm-show-action-window-other-window
+ (or helm-always-two-windows
+ helm--buffer-in-new-frame-p)
+ (eq helm-split-window-state 'vertical))
+ (if (< (window-width (helm-window))
+ (or split-width-threshold 160))
+ 'below
+ helm-show-action-window-other-window)))
(defun helm-select-action ()
"Select an action for the currently selected candidate.
@@ -5581,13 +5585,16 @@ If action buffer is selected, back to the Helm buffer."
(with-selected-frame (with-helm-window (selected-frame))
(prog1
(helm-acond ((get-buffer-window helm-action-buffer 'visible)
- (set-window-buffer it helm-buffer)
- (helm--set-action-prompt 'restore)
- (when (helm--show-action-window-other-window-p)
- (delete-window it))
- (kill-buffer helm-action-buffer)
- (setq helm-saved-selection nil)
- (helm-set-pattern helm-input 'noupdate))
+ (let ((delta (window-total-height it)))
+ (set-window-buffer it helm-buffer)
+ (helm--set-action-prompt 'restore)
+ (when (helm--show-action-window-other-window-p)
+ (delete-window it))
+ (when (memq helm-show-action-window-other-window
'(below above))
+ (window-resize (get-buffer-window helm-buffer)
delta))
+ (kill-buffer helm-action-buffer)
+ (setq helm-saved-selection nil)
+ (helm-set-pattern helm-input 'noupdate)))
(helm-saved-selection
(setq helm-saved-current-source src)
(let ((actions (helm-get-actions-from-current-source
src))
@@ -5648,9 +5655,8 @@ If action buffer is selected, back to the Helm buffer."
(erase-buffer)
(buffer-disable-undo)
(setq cursor-type nil)
- (set-window-buffer (if (helm--show-action-window-other-window-p)
- (split-window (get-buffer-window helm-buffer)
- nil
helm-show-action-window-other-window)
+ (set-window-buffer (helm-aif (helm--show-action-window-other-window-p)
+ (split-window (get-buffer-window helm-buffer) nil
it)
(get-buffer-window helm-buffer))
helm-action-buffer)
(set (make-local-variable 'helm-sources)