mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-24 16:30:58 -05:00
module!: add :editor whitespace
BREAKING CHANGE: Moves ws-butler, dtrt-indent, and whitespace defaults out of Doom's core and into a new module. ws-butler is gated behind +trim and dtrt-indent behind +guess. Users who depend on/like these packages will need to enable the new module and their respective flags (which is the default going forward). This change is motivated by an ongoing effort to slim down Doom's core (by (re)moving non-essentials from it). This also addresses an issue where dtrt-indent would vastly increase load times for some major-modes (e.g. elixir-mode & elm-mode, see #7537) by restricting it to non-project files and non-read-only buffers AND excludign those two major modes from indent guessing. Fix: #8516 Fix: #7537
This commit is contained in:
@@ -64,14 +64,15 @@ wrapped at `fill-column' by configuring `+word-wrap-fill-style'."
|
||||
(eq +word-wrap-fill-style 'soft)))
|
||||
|
||||
(unless +word-wrap--major-mode-is-visual
|
||||
(require 'dtrt-indent) ; for dtrt-indent--search-hook-mapping
|
||||
(setq-local +word-wrap--major-mode-indent-var
|
||||
(let ((indent-var (caddr (dtrt-indent--search-hook-mapping major-mode))))
|
||||
(if (listp indent-var)
|
||||
(car indent-var)
|
||||
indent-var)))
|
||||
|
||||
(advice-add #'adaptive-wrap-fill-context-prefix :around #'+word-wrap--adjust-extra-indent-a))
|
||||
(when (require 'dtrt-indent nil t)
|
||||
;; for dtrt-indent--search-hook-mapping
|
||||
;; TODO: Generalize this?
|
||||
(setq-local +word-wrap--major-mode-indent-var
|
||||
(let ((indent-var (caddr (dtrt-indent--search-hook-mapping major-mode))))
|
||||
(if (listp indent-var)
|
||||
(car indent-var)
|
||||
indent-var)))
|
||||
(advice-add #'adaptive-wrap-fill-context-prefix :around #'+word-wrap--adjust-extra-indent-a)))
|
||||
|
||||
(when +word-wrap--enable-adaptive-wrap-mode
|
||||
(adaptive-wrap-prefix-mode +1))
|
||||
|
Reference in New Issue
Block a user