Replace delete-trailing-whitespace with ws-butler
ws-butler only strips trailing spaces on lines that have been modified. + ws-butler is disabled if editorconfig enables trim_trailing_whitespace, which resorts to delete-trailing-whitespace instead. + Updates doom|(enable|disable)-delete-trailing-whitespace hooks to use ws-butler-mode.
This commit is contained in:
parent
a33165d47a
commit
d80e79203a
4 changed files with 20 additions and 9 deletions
|
@ -42,7 +42,15 @@ extension, try to guess one."
|
|||
(apply orig-fn args)))
|
||||
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)
|
||||
|
||||
(defun +editorconfig|disable-ws-butler-maybe (props)
|
||||
"Disable `ws-butler-mode' if trim_trailing_whitespace is true."
|
||||
(when (equal (gethash 'trim_trailing_whitespace props) "true")
|
||||
(ws-butler-mode -1)))
|
||||
(add-hook 'editorconfig-custom-hooks #'+editorconfig|disable-ws-butler-maybe)
|
||||
|
||||
(defun +editorconfig|disable-indent-detection (props)
|
||||
"Inhibit `dtrt-indent' if an explicit indent_style and indent_size is
|
||||
specified by editorconfig."
|
||||
(when (or (gethash 'indent_style props)
|
||||
(gethash 'indent_size props))
|
||||
(setq doom-inhibit-indent-detection t)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue