emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 a547b0e2e83: rust-ts-mode--comment-docstring: Fix/improve the p


From: Dmitry Gutov
Subject: emacs-29 a547b0e2e83: rust-ts-mode--comment-docstring: Fix/improve the previous change
Date: Sat, 2 Dec 2023 12:00:10 -0500 (EST)

branch: emacs-29
commit a547b0e2e832054f63bb1ed5a715a9c28759ba09
Author: Christophe TROESTLER <Christophe.TROESTLER@umons.ac.be>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    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.
---
 lisp/progmodes/rust-ts-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index a07634199ff..18951a10c55 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]