Move to global-mode-string
This commit is contained in:
parent
7ddfb6271d
commit
c224e2e771
3 changed files with 41 additions and 44 deletions
|
@ -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)
|
||||
|
|
|
@ -130,7 +130,28 @@ server getting expensively restarted when reverting buffers."
|
|||
(or doom-debug-p
|
||||
(not (eq +lsp-prompt-to-install-server 'quiet)))))
|
||||
(doom-shut-up-a #'lsp--info "No language server available for %S"
|
||||
major-mode))))))
|
||||
major-mode)))))
|
||||
|
||||
(when (featurep! :ui modeline +light)
|
||||
(defvar-local lsp-modeline-icon nil)
|
||||
|
||||
(add-hook! '(lsp-before-initialize-hook
|
||||
lsp-after-initialize-hook
|
||||
lsp-after-uninitialized-functions
|
||||
lsp-before-open-hook
|
||||
lsp-after-open-hook)
|
||||
(defun +lsp-update-modeline (&rest _)
|
||||
"Update modeline with lsp state."
|
||||
(let* ((workspaces (lsp-workspaces))
|
||||
(face (if workspaces 'success 'warning))
|
||||
(label (if workspaces "LSP Connected" "LSP Disconnected")))
|
||||
(setq lsp-modeline-icon (concat
|
||||
" "
|
||||
(+modeline-format-icon 'faicon "rocket" "" face label -0.0575)
|
||||
" "))
|
||||
(add-to-list 'global-mode-string
|
||||
'(t (:eval lsp-modeline-icon))
|
||||
'append))))))
|
||||
|
||||
|
||||
(use-package! lsp-ui
|
||||
|
|
|
@ -485,44 +485,6 @@ lines are selected, or the NxM dimensions of a block selection.")
|
|||
(add-hook 'deactivate-mark-hook #'+modeline-remove-selection-segment-h))
|
||||
|
||||
|
||||
;;; `+modeline-repl'
|
||||
(progn
|
||||
(def-modeline-var! +modeline-repl nil
|
||||
"Display REPL connection status icon."
|
||||
:local t)
|
||||
|
||||
(add-hook! '(cider-connected-hook
|
||||
cider-disconnected-hook
|
||||
cider-mode-hook)
|
||||
(defun +modeline-repl-cider-update ()
|
||||
"Update repl connection to cider connection state."
|
||||
(let* ((connected (cider-connected-p))
|
||||
(face (if connected 'success 'warning))
|
||||
(label (if connected "Cider connected" "Cider disconnected")))
|
||||
(setq +modeline-repl
|
||||
(+modeline-format-icon 'faicon "terminal" "" face label -0.0575))))))
|
||||
|
||||
|
||||
;;; `+modeline-lsp'
|
||||
(progn
|
||||
(def-modeline-var! +modeline-lsp nil
|
||||
"Display LSP connection status icon for the current buffer."
|
||||
:local t)
|
||||
|
||||
(add-hook! '(lsp-before-initialize-hook
|
||||
lsp-after-initialize-hook
|
||||
lsp-after-uninitialized-functions
|
||||
lsp-before-open-hook
|
||||
lsp-after-open-hook)
|
||||
(defun +modeline-lsp-update (&rest _)
|
||||
"Update lsp state."
|
||||
(let* ((workspaces (lsp-workspaces))
|
||||
(face (if workspaces 'success 'warning))
|
||||
(label (if workspaces "LSP Connected" "LSP Disconnected")))
|
||||
(setq +modeline-lsp
|
||||
(+modeline-format-icon 'faicon "rocket" "" face label -0.0575))))))
|
||||
|
||||
|
||||
;;; `+modeline-encoding'
|
||||
(def-modeline-var! +modeline-encoding
|
||||
`(:eval
|
||||
|
@ -555,11 +517,6 @@ lines are selected, or the NxM dimensions of a block selection.")
|
|||
+modeline-position)
|
||||
`(""
|
||||
mode-line-misc-info
|
||||
" "
|
||||
+modeline-repl
|
||||
" "
|
||||
+modeline-lsp
|
||||
" "
|
||||
+modeline-modes
|
||||
(vc-mode (" "
|
||||
,(all-the-icons-octicon "git-branch" :v-adjust 0.0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue