fix(vc-gutter): resist errors in kill-buffer advice

A regression introduced in aa8c31c.

Fix: #8018
Ref: #8009
Amend: aa8c31cf08
This commit is contained in:
Henrik Lissner 2024-08-22 16:04:22 -04:00
parent b521492bf4
commit 93c5f98ee2
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -192,8 +192,9 @@ Respects `diff-hl-disable-on-remote'."
;; triggered from Elisp's buffer API (from what I can tell). ;; triggered from Elisp's buffer API (from what I can tell).
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf) (defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
:before #'kill-buffer :before #'kill-buffer
(with-current-buffer (or buf (current-buffer)) (when-let ((buf (ignore-errors (window-normalize-buffer buf))))
(+vc-gutter--kill-thread t))) (with-current-buffer buf
(+vc-gutter--kill-thread t))))
;; HACK: diff-hl won't be visible in TTY frames, but there's no simple way to ;; HACK: diff-hl won't be visible in TTY frames, but there's no simple way to
;; use the fringe in GUI Emacs and use the margin in the terminal *AND* ;; use the fringe in GUI Emacs and use the margin in the terminal *AND*