ui/modeline: remove indent segment
It's wasted space now that dtrt-indent logs changes to indentation. Also resolves a performance issue where the tab/space unicode character would cause long 3-5s delays on startup or first-file load.
This commit is contained in:
parent
26050bb1d7
commit
4aa4802885
2 changed files with 2 additions and 31 deletions
|
@ -226,7 +226,7 @@ savehist file."
|
||||||
(add-hook! '(change-major-mode-after-body-hook read-only-mode-hook)
|
(add-hook! '(change-major-mode-after-body-hook read-only-mode-hook)
|
||||||
#'doom|detect-indentation)
|
#'doom|detect-indentation)
|
||||||
:config
|
:config
|
||||||
(setq dtrt-indent-verbosity (if doom-debug-mode 2 0))
|
(setq dtrt-indent-verbosity (if doom-debug-mode 2 1))
|
||||||
;; always keep tab-width up-to-date
|
;; always keep tab-width up-to-date
|
||||||
(push '(t tab-width) dtrt-indent-hook-generic-mapping-list)
|
(push '(t tab-width) dtrt-indent-hook-generic-mapping-list)
|
||||||
|
|
||||||
|
|
|
@ -51,39 +51,10 @@
|
||||||
(hide-mode-line-mode)))
|
(hide-mode-line-mode)))
|
||||||
(add-hook 'magit-mode-hook #'+modeline|hide-in-non-status-buffer)
|
(add-hook 'magit-mode-hook #'+modeline|hide-in-non-status-buffer)
|
||||||
|
|
||||||
;; Show indentation style in modeline. I'm not using
|
|
||||||
;; `doom-modeline-def-segment' to prevent eager macro expansion from loading
|
|
||||||
;; the package too soon.
|
|
||||||
(defun +modeline-indent-segment ()
|
|
||||||
"indent modeline segment"
|
|
||||||
(propertize (format "%s%d"
|
|
||||||
(if indent-tabs-mode "⭾" "␣")
|
|
||||||
tab-width)
|
|
||||||
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)
|
|
||||||
'mouse-face 'mode-line-highlight
|
|
||||||
'help-echo
|
|
||||||
(let ((subsegs
|
|
||||||
(list (format "Indentation style: %s (%d wide)"
|
|
||||||
(if indent-tabs-mode "tabs" "spaces")
|
|
||||||
tab-width)
|
|
||||||
(cond ((eq doom-inhibit-indent-detection 'editorconfig)
|
|
||||||
(propertize "✓ Editorconfig applied" 'face 'success))
|
|
||||||
(doom-inhibit-indent-detection
|
|
||||||
(propertize "✘ Indentation auto-detection disabled" 'face 'warning))
|
|
||||||
((bound-and-true-p dtrt-indent-original-indent)
|
|
||||||
(propertize (format "✓ Indentation auto-detected (original: %s)"
|
|
||||||
dtrt-indent-original-indent)
|
|
||||||
'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))
|
|
||||||
|
|
||||||
;; Remove unused segments & extra padding
|
;; Remove unused segments & extra padding
|
||||||
(doom-modeline-def-modeline 'main
|
(doom-modeline-def-modeline 'main
|
||||||
'(bar window-number matches buffer-info remote-host buffer-position selection-info)
|
'(bar window-number matches buffer-info remote-host buffer-position selection-info)
|
||||||
'(misc-info persp-name irc mu4e github debug indent input-method buffer-encoding lsp major-mode process vcs checker))
|
'(misc-info persp-name irc mu4e github debug input-method buffer-encoding lsp major-mode process vcs checker))
|
||||||
|
|
||||||
(doom-modeline-def-modeline 'special
|
(doom-modeline-def-modeline 'special
|
||||||
'(bar window-number matches buffer-info-simple buffer-position selection-info)
|
'(bar window-number matches buffer-info-simple buffer-position selection-info)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue