1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

rust-ts-mode--comment-docstring: Fix/improve the previous change

* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--comment-docstring): Match also "inner" line docs.
Stop rebinding 'end' and use the argument's value in the
'treesit-fontify-with-override' call.
This commit is contained in:
Christophe TROESTLER 2023-12-02 18:58:40 +02:00 committed by Dmitry Gutov
parent 5f882f4ee9
commit a547b0e2e8

View File

@ -290,13 +290,13 @@
(defun rust-ts-mode--comment-docstring (node override start end &rest _args)
"Use the comment or documentation face appropriately for comments."
(let* ((beg (treesit-node-start node))
(end (treesit-node-end node))
(face (save-excursion
(goto-char beg)
(if (looking-at "///")
(if (looking-at "//\\(?:/\\|!\\)")
'font-lock-doc-face
'font-lock-comment-face))))
(treesit-fontify-with-override beg end face override start end)))
(treesit-fontify-with-override beg (treesit-node-end node)
face override start end)))
(defun rust-ts-mode--fontify-scope (node override start end &optional tail-p)
(let* ((case-fold-search nil)