mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix 'buffer does not seem to be associated with any file' error
Fixes #2869 Closes #2870
This commit is contained in:
@ -48,12 +48,11 @@
|
|||||||
(defun +magit--revert-buffer (buffer)
|
(defun +magit--revert-buffer (buffer)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(kill-local-variable '+magit--stale-p)
|
(kill-local-variable '+magit--stale-p)
|
||||||
(let* ((buffer (or (buffer-base-buffer) (current-buffer)))
|
(when buffer-file-name
|
||||||
(file (buffer-file-name buffer)))
|
(if (buffer-modified-p (current-buffer))
|
||||||
(if (or (buffer-modified-p buffer)
|
|
||||||
(and file (file-exists-p file)))
|
|
||||||
(when (bound-and-true-p vc-mode)
|
(when (bound-and-true-p vc-mode)
|
||||||
(vc-refresh-state))
|
(vc-refresh-state)
|
||||||
|
(force-mode-line-update))
|
||||||
(revert-buffer t t)))))
|
(revert-buffer t t)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
Reference in New Issue
Block a user