Skip to content

Commit

Permalink
Allow meghanada to support hooks after a test is executed (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman authored and mopemope committed Nov 12, 2018
1 parent 0b36871 commit 13c4a7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion meghanada.el
Expand Up @@ -250,6 +250,9 @@ In linux or macOS, it can be \"mvn\"; In Windows, it can be \"mvn.cmd\". "
:group 'meghanada
:type 'string)

(defcustom meghanada-mode-after-test-hook '()
"Hook that is called after a JUnit test execution is done."
:group 'meghanada)
;;
;; utility
;;
Expand Down Expand Up @@ -758,7 +761,11 @@ function."
(setq eot t))
(when eot
(compilation-mode))))
(setq buffer-read-only t))
(setq buffer-read-only t)
;; Run all after test hooks now that the buffer is read-only
(when (string= buffer meghanada--junit-buf-name)
(run-hooks 'meghanada-mode-after-test-hook))
)
;; If the cursor is already at the end of the buffer or if
;; auto-scrolling is activated, move the cursor to the end of the buffer
;; (moves both buffer point and window point)
Expand Down

0 comments on commit 13c4a7d

Please sign in to comment.