Add evil-mc support to multiple-cursors segment

This commit is contained in:
Henrik Lissner 2019-03-05 16:59:32 -05:00
parent 80bc70fa82
commit ac8bcc2551
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1036,12 +1036,24 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(defsubst doom-modeline--multiple-cursors () (defsubst doom-modeline--multiple-cursors ()
"Show the number of multiple cursors." "Show the number of multiple cursors."
(when (bound-and-true-p multiple-cursors-mode) (cl-destructuring-bind (count . face)
(propertize (cond ((bound-and-true-p multiple-cursors-mode)
(concat (car mc/mode-line) (cons (eval (cadadr mc/mode-line))
(eval (cadadr mc/mode-line)) (if (doom-modeline--active)
" ") 'mode-line-inactive
'face (if (doom-modeline--active) 'doom-modeline-panel 'mode-line-inactive)))) 'doom-modeline-eldoc-bar)))
((bound-and-true-p evil-mc-cursor-list)
(cons (length evil-mc-cursor-list)
(cond ((not (doom-modeline--active)) 'mode-line-inactive)
(evil-mc-frozen 'doom-modeline-panel)
('doom-modeline-eldoc-bar))))
((cons nil nil)))
(when count
(concat (propertize " " 'face face)
(doom-modeline-icon-faicon "i-cursor" :face face :v-adjust -0.1)
(propertize doom-modeline-vspc 'face `(:inherit (variable-pitch ,face)))
(propertize (format "%d " count)
'face face)))))
(defsubst doom-modeline--buffer-size () (defsubst doom-modeline--buffer-size ()
"Show buffer size." "Show buffer size."