From ea97adf9c7272cd5b6dc783d07d020c38d13da0a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 25 Aug 2024 17:13:09 -0400 Subject: [PATCH] fix: set jump points on more kill-buffer functions Close: #7643 Co-authored-by: LemonBreezes --- lisp/doom-editor.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/doom-editor.el b/lisp/doom-editor.el index 8df0c3778..7c2af2a71 100644 --- a/lisp/doom-editor.el +++ b/lisp/doom-editor.el @@ -486,7 +486,8 @@ files, so this replace calls to `pp' with the much faster `prin1'." (defun doom-set-jump-h () "Run `better-jumper-set-jump' but return nil, for short-circuiting hooks." - (better-jumper-set-jump) + (when (get-buffer-window) + (better-jumper-set-jump)) nil) ;; Creates a jump point before killing a buffer. This allows you to undo @@ -495,7 +496,7 @@ files, so this replace calls to `pp' with the much faster `prin1'." ;; ;; I'm not advising `kill-buffer' because I only want this to affect ;; interactively killed buffers. - (advice-add #'kill-current-buffer :around #'doom-set-jump-a) + (add-hook 'kill-buffer-hook #'doom-set-jump-h) ;; Create a jump point before jumping with imenu. (advice-add #'imenu :around #'doom-set-jump-a))