Fix 'buffer does not seem to be associated with any file' error
Fixes #2869 Closes #2870
This commit is contained in:
parent
24e35b95d5
commit
3622e36c75
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue