Skip to content

Commit 1b4642a

Browse files
kermorgantzonuexe
authored andcommitted
add phpactor-update-file-hook (#109)
This allows user add extra behaviour (like code formatting) after buffer is modified by phpactor.
1 parent 94885b4 commit 1b4642a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

phpactor.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
(defvar phpactor-history-ring nil)
8585

8686
(defvar phpactor--buffer-name "*Phpactor*")
87+
(defvar phpactor-after-update-file-hook nil
88+
"Hook called after the file is updated by phpactor.")
8789

8890
;;; Constants
8991
(defconst phpactor-command-name "phpactor")
@@ -505,7 +507,8 @@ function."
505507
(message "Buffer modified by phpactor")))
506508

507509
(kill-buffer patchbuf)
508-
(delete-file tmpfile)))))
510+
(delete-file tmpfile)))
511+
(run-hooks 'phpactor-after-update-file-hook)))
509512

510513
;; Dispatcher:
511514
(cl-defun phpactor-action-dispatch (&key action parameters version)

0 commit comments

Comments
 (0)