From 2790b34b9535fb288bbd82ebc4da9fc9e527a954 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Sat, 2 Dec 2023 21:51:15 +0100 Subject: [PATCH] rust-ts-mode--comment-docstring: Handle block doc comments * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--comment-docstring): Handle block doc comments. Inhibit match-data modification. --- lisp/progmodes/rust-ts-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 1a1f6ace047..c4efea0e7d2 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -298,7 +298,7 @@ (let* ((beg (treesit-node-start node)) (face (save-excursion (goto-char beg) - (if (looking-at "//\\(?:/\\|!\\)") + (if (looking-at "/\\(?:/\\(?:/[^/]\\|!\\)\\|*\\(?:*[^*/]\\|!\\)\\)" t) 'font-lock-doc-face 'font-lock-comment-face)))) (treesit-fontify-with-override beg (treesit-node-end node) -- 2.39.2