tweak(markdown): fontify code blocks natively
Enable `markdown-fontify-code-blocks-natively`, which was disabled inf5570db
due to performance issues, which I try to fix by suppressing mode hooks on `markdown-fontify-code-block-natively`. Amend:f5570db4c2
Close: #7930 Co-authored-by: real-or-random <real-or-random@users.noreply.github.com>
This commit is contained in:
parent
68771150ba
commit
df5f6696ec
1 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,7 @@ capture, the end position, and the output buffer.")
|
||||||
markdown-gfm-additional-languages '("sh")
|
markdown-gfm-additional-languages '("sh")
|
||||||
markdown-make-gfm-checkboxes-buttons t
|
markdown-make-gfm-checkboxes-buttons t
|
||||||
markdown-fontify-whole-heading-line t
|
markdown-fontify-whole-heading-line t
|
||||||
|
markdown-fontify-code-blocks-natively t
|
||||||
|
|
||||||
;; `+markdown-compile' offers support for many transpilers (see
|
;; `+markdown-compile' offers support for many transpilers (see
|
||||||
;; `+markdown-compile-functions'), which it tries until one succeeds.
|
;; `+markdown-compile-functions'), which it tries until one succeeds.
|
||||||
|
@ -73,6 +74,13 @@ capture, the end position, and the output buffer.")
|
||||||
:override #'markdown-match-generic-metadata
|
:override #'markdown-match-generic-metadata
|
||||||
(ignore (goto-char (point-max))))
|
(ignore (goto-char (point-max))))
|
||||||
|
|
||||||
|
;; HACK: markdown-mode calls a major mode without inhibiting its hooks, which
|
||||||
|
;; could contain expensive functionality. I suppress it to speed up their
|
||||||
|
;; fontification.
|
||||||
|
(defadvice! +markdown-optimize-src-buffer-modes-a (fn &rest args)
|
||||||
|
:around #'markdown-fontify-code-block-natively
|
||||||
|
(delay-mode-hooks (apply fn args)))
|
||||||
|
|
||||||
(map! :map markdown-mode-map
|
(map! :map markdown-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
"'" #'markdown-edit-code-block
|
"'" #'markdown-edit-code-block
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue