mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(language/markdown): improve prettier setup
Only wrap lines to fill-column when formatting with prettier if auto-fill-mode is enabled.
This commit is contained in:
@@ -56,9 +56,12 @@
|
||||
(subword-mode t))
|
||||
|
||||
(defun siren-markdown-mode-setup-prettier ()
|
||||
(setq-local prettier-js-args `("--parser" "markdown"
|
||||
"--print-width" ,(number-to-string fill-column)
|
||||
"--prose-wrap" "always"))))
|
||||
(let ((args '("--parser" "markdown")))
|
||||
(when (bound-and-true-p auto-fill-function) ;; is auto-fill-mode enabled?
|
||||
(setq args (append args (list "--print-width" (format "%d" fill-column)
|
||||
"--prose-wrap" "always"))))
|
||||
|
||||
(setq-local prettier-js-args args))))
|
||||
|
||||
;; Required by markdown-edit-code-block.
|
||||
(use-package edit-indirect
|
||||
|
||||
Reference in New Issue
Block a user