Change the visited file name of the renamed file's buffer
If ‘p4-vc-rename-file’ is used and the file that's been renamed is open in a buffer, change that buffer's visited file name so that when you switch to it and start editing it, it doesn't save to the original file and your modifications will have to be moved over.
This commit is contained in:
parent
4ecf8cd2bc
commit
99ca65c5cb
1 changed files with 6 additions and 1 deletions
|
@ -35,6 +35,8 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'subr-x)
|
||||
|
||||
(defgroup p4-lowlevel nil
|
||||
"Emacs-lisp interface to Perforce operations."
|
||||
:group 'tools)
|
||||
|
@ -818,7 +820,10 @@ only on the server and not touch the local files."
|
|||
preview-args
|
||||
server-only-args
|
||||
(list from-file to-file))))
|
||||
(p4-lowlevel-command-or-error args)))
|
||||
(p4-lowlevel-command-or-error args)
|
||||
(when-let* ((buffer (find-buffer-visiting from-file)))
|
||||
(with-current-buffer buffer
|
||||
(set-visited-file-name to-file)))))
|
||||
|
||||
(provide 'p4-lowlevel)
|
||||
|
||||
|
|
Loading…
Reference in a new issue