Merge pull request #137 from hlissner/evil-mc

Add evil-mc support to multiple-cursors segment
This commit is contained in:
Vincent Zhang 2019-03-07 13:31:24 +07:00 committed by GitHub
commit 55f5ccebb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1036,12 +1036,24 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(defsubst doom-modeline--multiple-cursors ()
"Show the number of multiple cursors."
(when (bound-and-true-p multiple-cursors-mode)
(propertize
(concat (car mc/mode-line)
(eval (cadadr mc/mode-line))
" ")
'face (if (doom-modeline--active) 'doom-modeline-panel 'mode-line-inactive))))
(cl-destructuring-bind (count . face)
(cond ((bound-and-true-p multiple-cursors-mode)
(cons (eval (cadadr mc/mode-line))
(if (doom-modeline--active)
'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 ()
"Show buffer size."