Revert buffer after renaming file
This commit is contained in:
parent
e00560caf8
commit
247ce145b4
1 changed files with 2 additions and 4 deletions
|
@ -202,10 +202,7 @@ single file or nested compound statement of `and' and `or' statements."
|
|||
(let (toplevels)
|
||||
(dolist (file files)
|
||||
(when (featurep 'vc)
|
||||
(vc-file-clearprops file)
|
||||
(when-let (buffer (get-file-buffer file))
|
||||
(with-current-buffer buffer
|
||||
(vc-refresh-state))))
|
||||
(vc-file-clearprops file))
|
||||
(when (featurep 'magit)
|
||||
(when-let (default-directory (magit-toplevel (file-name-directory file)))
|
||||
(cl-pushnew default-directory toplevels)))
|
||||
|
@ -286,6 +283,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
|
|||
(make-directory (file-name-directory new-path) 't)
|
||||
(rename-file old-path new-path (or force-p 1))
|
||||
(set-visited-file-name new-path t t)
|
||||
(revert-buffer t t)
|
||||
(doom--update-files old-path new-path)
|
||||
(message "File moved to %S" (abbreviate-file-name new-path))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue