mirror of
https://github.com/vale981/doom-modeline
synced 2025-03-05 09:21:38 -05:00
Use derived-mode-p
This commit is contained in:
parent
d4b4ea4d61
commit
0bba9c4db8
2 changed files with 5 additions and 5 deletions
|
@ -249,9 +249,9 @@ It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'."
|
|||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-continuous-word-count-modes
|
||||
'(markdown-mode org-mode)
|
||||
'(text-mode)
|
||||
"Major modes in which to display word count continuously.
|
||||
Respects `doom-modeline-enable-word-count'."
|
||||
Also applies to any derived modes. Respects `doom-modeline-enable-word-count'."
|
||||
:type 'list
|
||||
:group 'doom-modeline)
|
||||
|
||||
|
|
|
@ -1030,10 +1030,10 @@ mouse-1: List all problems%s"
|
|||
|
||||
(doom-modeline-def-segment word-count
|
||||
"The buffer word count.
|
||||
Displayed when in a major mode in `doom-modeline-continuous-word-count-modes'.
|
||||
Respects `doom-modeline-enable-word-count'."
|
||||
Displayed when in a major mode in `doom-modeline-continuous-word-count-modes',
|
||||
or any derived mode. Respects `doom-modeline-enable-word-count'."
|
||||
(when (and doom-modeline-enable-word-count
|
||||
(member major-mode doom-modeline-continuous-word-count-modes))
|
||||
(apply #'derived-mode-p doom-modeline-continuous-word-count-modes))
|
||||
(let ((word-count (format " %dW" (count-words (point-min) (point-max)))))
|
||||
(if (doom-modeline--active)
|
||||
word-count
|
||||
|
|
Loading…
Add table
Reference in a new issue