Skip to content

Commit 6f6af1f

Browse files
authored
Merge pull request #96 from emacs-php/hotfix/bugfix-95
fix #95 : use path in phpactor-action-update-file-source
2 parents 9d701a6 + 81c1ef5 commit 6f6af1f

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

phpactor.el

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -457,23 +457,23 @@ function."
457457
(patchbuf (get-buffer-create "*Phpactor patch*"))
458458
(coding-system-for-read 'utf-8)
459459
(coding-system-for-write 'utf-8))
460-
461-
(unwind-protect
462-
(save-restriction
463-
(widen)
464-
(with-current-buffer patchbuf
465-
(erase-buffer))
466-
467-
(with-temp-file tmpfile
468-
(insert source))
469-
470-
(if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
471-
(message "Buffer was unchanged by phpactor")
472-
(phpactor--apply-rcs-patch patchbuf)
473-
(message "Buffer modified by phpactor")))
474-
475-
(kill-buffer patchbuf)
476-
(delete-file tmpfile))))
460+
(with-current-buffer (find-file path)
461+
(unwind-protect
462+
(save-restriction
463+
(widen)
464+
(with-current-buffer patchbuf
465+
(erase-buffer))
466+
467+
(with-temp-file tmpfile
468+
(insert source))
469+
470+
(if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
471+
(message "Buffer was unchanged by phpactor")
472+
(phpactor--apply-rcs-patch patchbuf)
473+
(message "Buffer modified by phpactor")))
474+
475+
(kill-buffer patchbuf)
476+
(delete-file tmpfile)))))
477477

478478
;; Dispatcher:
479479
(cl-defun phpactor-action-dispatch (&key action parameters version)

0 commit comments

Comments
 (0)