Skip to content

Commit

Permalink
Fix resuming previous buffer when current session
Browse files Browse the repository at this point in the history
is not resumable.

* helm.el (helm-resume-previous-session-after-quit): Do it.
  • Loading branch information
Thierry Volpiatto committed Oct 3, 2019
1 parent 797a990 commit 0880c77
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions helm.el
Original file line number Diff line number Diff line change
Expand Up @@ -2678,13 +2678,14 @@ as a string with ARG."
:buffer any-buffer)
(run-hook-with-args 'helm-resume-after-hook sources))))))

(defun helm-resume-previous-session-after-quit (arg)
(defun helm-resume-previous-session-after-quit ()
"Resume previous helm session within a running helm."
(interactive "p")
(interactive)
(with-helm-alive-p
(if (>= (length helm-buffers) arg)
(helm-run-after-exit (lambda () (helm-resume (nth arg helm-buffers))))
(message "No previous helm sessions available for resuming!"))))
(let ((arg (if (null (member helm-buffer helm-buffers)) 0 1)))
(if (> (length helm-buffers) arg)
(helm-run-after-exit (lambda () (helm-resume (nth arg helm-buffers))))
(message "No previous helm sessions available for resuming!")))))
(put 'helm-resume-previous-session-after-quit 'helm-only t)

(defun helm-resume-list-buffers-after-quit ()
Expand Down

0 comments on commit 0880c77

Please sign in to comment.