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)
|
||||
(with-current-buffer buffer
|
||||
(kill-local-variable '+magit--stale-p)
|
||||
(let* ((buffer (or (buffer-base-buffer) (current-buffer)))
|
||||
(file (buffer-file-name buffer)))
|
||||
(if (or (buffer-modified-p buffer)
|
||||
(and file (file-exists-p file)))
|
||||
(when buffer-file-name
|
||||
(if (buffer-modified-p (current-buffer))
|
||||
(when (bound-and-true-p vc-mode)
|
||||
(vc-refresh-state))
|
||||
(vc-refresh-state)
|
||||
(force-mode-line-update))
|
||||
(revert-buffer t t)))))
|
||||
|
||||
;;;###autoload
|
||||
|
Reference in New Issue
Block a user