mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
ui/modeline: correct & refactor indent segment
Incorrectly displayed "auto-detection disabled" when it wasn't.
This commit is contained in:
@ -38,21 +38,22 @@
|
|||||||
tab-width)
|
tab-width)
|
||||||
'mouse-face 'mode-line-highlight
|
'mouse-face 'mode-line-highlight
|
||||||
'help-echo
|
'help-echo
|
||||||
(mapconcat #'identity
|
(let ((subsegs
|
||||||
(list (format "Indentation style: %s (%d wide)"
|
(list (format "Indentation style: %s (%d wide)"
|
||||||
(if indent-tabs-mode "tabs" "spaces")
|
(if indent-tabs-mode "tabs" "spaces")
|
||||||
tab-width)
|
tab-width)
|
||||||
(if (eq doom-inhibit-indent-detection 'editorconfig)
|
(cond ((eq doom-inhibit-indent-detection 'editorconfig)
|
||||||
(propertize "✓ Editorconfig applied" 'face 'success)
|
(propertize "✓ Editorconfig applied" 'face 'success))
|
||||||
|
(doom-inhibit-indent-detection
|
||||||
(propertize "✘ Indentation auto-detection disabled" 'face 'warning))
|
(propertize "✘ Indentation auto-detection disabled" 'face 'warning))
|
||||||
(when (bound-and-true-p ws-butler-mode)
|
((bound-and-true-p dtrt-indent-original-indent)
|
||||||
(propertize "✓ ws-butler active (whitespace cleanup on save)"
|
|
||||||
'face 'success))
|
|
||||||
(when (bound-and-true-p dtrt-indent-original-indent)
|
|
||||||
(propertize (format "✓ Indentation auto-detected (original: %s)"
|
(propertize (format "✓ Indentation auto-detected (original: %s)"
|
||||||
dtrt-indent-original-indent)
|
dtrt-indent-original-indent)
|
||||||
'face 'success)))
|
'face 'success)))
|
||||||
" ")))
|
(when (bound-and-true-p ws-butler-mode)
|
||||||
|
(propertize "✓ ws-butler active (whitespace cleanup on save)"
|
||||||
|
'face 'success)))))
|
||||||
|
(string-join (delq nil subsegs) " "))))
|
||||||
(add-to-list 'doom-modeline-fn-alist '(indent . +modeline-indent-segment))
|
(add-to-list 'doom-modeline-fn-alist '(indent . +modeline-indent-segment))
|
||||||
|
|
||||||
;; Remove unused segments & extra padding
|
;; Remove unused segments & extra padding
|
||||||
|
Reference in New Issue
Block a user