Skip to content

Instantly share code, notes, and snippets.

@xiaoDC
Created January 20, 2019 10:09
Show Gist options
  • Save xiaoDC/baa3881894b1adfc80595838401c10a3 to your computer and use it in GitHub Desktop.
Save xiaoDC/baa3881894b1adfc80595838401c10a3 to your computer and use it in GitHub Desktop.
(defun helm-persistent-action-display-window (&optional split-onewindow)
"Return the window that will be used for persistent action.
If SPLIT-ONEWINDOW is non-`nil' window is split in persistent action."
(with-helm-window
(setq helm-persistent-action-display-window
(cond ((and (window-live-p helm-persistent-action-display-window)
(not (member helm-persistent-action-display-window
(get-buffer-window-list helm-buffer))))
helm-persistent-action-display-window)
((and helm--buffer-in-new-frame-p helm-initial-frame)
(with-selected-frame helm-initial-frame (selected-window)))
(split-onewindow (split-window))
((get-mru-window))
(t split-window (get-mru-window nil t))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment