diff options
author | Yuan Fu <casouri@gmail.com> | 2022-12-29 11:52:06 -0800 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-12-29 11:52:06 -0800 |
commit | 558b59d81b938fc434e62523106360b9704c88e2 (patch) | |
tree | 976acba62e862b7c3440105161c9d58ca0db40a7 /lisp/textmodes | |
parent | a96a7c811517063053a1dffc30ac94deffad503f (diff) | |
download | emacs-558b59d81b938fc434e62523106360b9704c88e2.tar.gz emacs-558b59d81b938fc434e62523106360b9704c88e2.tar.bz2 emacs-558b59d81b938fc434e62523106360b9704c88e2.zip |
Add color fontification in css-ts-mode (bug#60405)
* lisp/textmodes/css-mode.el (css-ts-mode): Add color fontification
and syntax-propertize-function.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r-- | lisp/textmodes/css-mode.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 19f5fa303f9..e8d97259489 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1804,11 +1804,15 @@ can also be used to fill comments. :syntax-table css-mode-syntax-table (when (treesit-ready-p 'css) ;; Borrowed from `css-mode'. + (setq-local syntax-propertize-function + css-syntax-propertize-function) (add-hook 'completion-at-point-functions #'css-completion-at-point nil 'local) (setq-local fill-paragraph-function #'css-fill-paragraph) (setq-local adaptive-fill-function #'css-adaptive-fill) - (setq-local add-log-current-defun-function #'css-current-defun-name) + ;; `css--fontify-region' first calls the default function, which + ;; will call tree-sitter's function, then it fontifies colors. + (setq-local font-lock-fontify-region-function #'css--fontify-region) ;; Tree-sitter specific setup. (treesit-parser-create 'css) |