(defn
heads-up-plugin-msg-handler
[opts msg-hist']
(let
[msg-hist
(focus-msgs
#{:compile-failed :compile-warning :files-changed}
msg-hist')
msg-names
(map :msg-name msg-hist)
msg
(first msg-hist)]
(go
(cond
(reload-file-state? msg-names opts)
(if
(and (autoload?) (:autoload opts))
(<! (heads-up/flash-loaded))
(<! (heads-up/clear)))
(compile-refail-state? msg-names)
(do
(<! (heads-up/clear))
(<! (heads-up/display-exception (:exception-data msg)))
(auto-jump-to-error opts (:exception-data msg)))
(compile-fail-state? msg-names)
(do
(<! (heads-up/display-exception (:exception-data msg)))
(auto-jump-to-error opts (:exception-data msg)))
(warning-append-state? msg-names)
(heads-up/append-warning-message (:message msg))
(rewarning-state? msg-names)
(do
(<! (heads-up/clear))
(<! (heads-up/display-warning (:message msg)))
(auto-jump-to-error opts (:message msg)))
(warning-state? msg-names)
(do
(<! (heads-up/display-warning (:message msg)))
(auto-jump-to-error opts (:message msg)))
(css-loaded-state? msg-names)
(<! (heads-up/flash-loaded))))))