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
|
@ -81,11 +81,6 @@ fundamental-mode) for performance sake."
|
|||
|
||||
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
|
||||
|
||||
;; Deleting trailing whitespace is on by default, but must be set on
|
||||
;; write-file-functions, so that editorconfig can see it (so it doesn't add it
|
||||
;; redundantly and can remove it when needed).
|
||||
(add-hook 'write-file-functions #'delete-trailing-whitespace)
|
||||
|
||||
;; revert buffers for changed files
|
||||
(def-package! autorevert
|
||||
:after-call after-find-file
|
||||
|
@ -300,5 +295,12 @@ savehist file."
|
|||
[remap describe-variable] #'helpful-variable
|
||||
[remap describe-key] #'helpful-key)
|
||||
|
||||
;; `ws-butler' --- a better `delete-trailing-whitespaces'
|
||||
(def-package! ws-butler
|
||||
:after-call (after-find-file)
|
||||
:config
|
||||
(nconc ws-butler-global-exempt-modes '(special-mode comint-mode term-mode eshell-mode))
|
||||
(ws-butler-global-mode))
|
||||
|
||||
(provide 'core-editor)
|
||||
;;; core-editor.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue