Skip to content

Commit

Permalink
Split helm-window to display PA (#2050)
Browse files Browse the repository at this point in the history
and delete PA window on update, makes the PA themselves for
buffers and files deleting the window when removing the candidate
preview.

* helm-buffers.el (helm-buffers-list-persistent-action): Do it.
* helm-files.el (helm-ff-kill-or-find-buffer-fname):     Do it.
* helm.el (helm-persistent-action-display-window):       Do it.
  • Loading branch information
Thierry Volpiatto committed May 31, 2018
1 parent 1610e2d commit cb8718a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion helm-buffers.el
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,11 @@ If a prefix arg is given split windows vertically."
(eql current (get-buffer helm-current-buffer))
(not (eql current (get-buffer candidate))))
(switch-to-buffer candidate)
(switch-to-buffer helm-current-buffer))))
(if (and helm-persistent-action-display-window
(window-dedicated-p
(next-window helm-persistent-action-display-window 1)))
(delete-window helm-persistent-action-display-window)
(switch-to-buffer helm-current-buffer)))))

(defun helm-ediff-marked-buffers (_candidate &optional merge)
"Ediff 2 marked buffers or CANDIDATE and `helm-current-buffer'.
Expand Down
5 changes: 4 additions & 1 deletion helm-files.el
Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,10 @@ in `helm-find-files-persistent-action-if'."
(message "Can't kill modified buffer, please save it before"))
((and buf win)
(kill-buffer buf)
(set-window-buffer win helm-current-buffer)
(if (and helm-persistent-action-display-window
(window-dedicated-p (next-window win 1)))
(delete-window helm-persistent-action-display-window)
(set-window-buffer win helm-current-buffer))
(message "Buffer `%s' killed" buf-name))
(t (find-file candidate)))))

Expand Down
13 changes: 8 additions & 5 deletions helm.el
Original file line number Diff line number Diff line change
Expand Up @@ -6068,14 +6068,17 @@ If SPLIT-ONEWINDOW is non-`nil' window is split in persistent action."
((and helm--buffer-in-new-frame-p helm-initial-frame)
(with-selected-frame helm-initial-frame (selected-window)))
(split-onewindow (split-window))
;; Fix Issue #2050 with dedicatd window.
;; Fix Issue #2050 with dedicated window.
((window-dedicated-p
(setq next-win (next-window (selected-window) 1)))
(with-helm-after-update-hook
(and (window-live-p helm-persistent-action-display-window)
(delete-window helm-persistent-action-display-window)))
(split-window))
((window-dedicated-p
(setq cur-win (get-buffer-window helm-current-buffer)))
(split-window cur-win))
(split-window))
(cur-win)
((window-dedicated-p
(setq next-win (next-window (selected-window) 1)))
(split-window next-win))
(t next-win))))))

(defun helm-select-persistent-action-window (&optional split-onewindow)
Expand Down

0 comments on commit cb8718a

Please sign in to comment.