Move to global-mode-string

This commit is contained in:
Eric Dallo 2020-06-05 21:42:36 -03:00
parent 7ddfb6271d
commit c224e2e771
No known key found for this signature in database
GPG key ID: 985DD2B6664886B8
3 changed files with 41 additions and 44 deletions

View file

@ -94,6 +94,25 @@
(evil-make-overriding-map cider--debug-mode-map 'normal)
(evil-normalize-keymaps))))
(when (featurep! :ui modeline +light)
(defvar-local cider-modeline-icon nil)
(add-hook! '(cider-connected-hook
cider-disconnected-hook
cider-mode-hook)
(defun +clojure--cider-update-modeline ()
"Update modeline with cider connection state."
(let* ((connected (cider-connected-p))
(face (if connected 'success 'warning))
(label (if connected "Cider connected" "Cider disconnected")))
(setq cider-modeline-icon (concat
" "
(+modeline-format-icon 'faicon "terminal" "" face label -0.0575)
" "))
(add-to-list 'global-mode-string
'cider-modeline-icon
'append)))))
;; The CIDER welcome message obscures error messages that the above code is
;; supposed to be make visible.
(setq cider-repl-display-help-banner nil)