From 991f9ae2e4fd6092f350c991a63b4762e5f771fb Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 1 May 2024 21:21:00 -0700 Subject: [PATCH] Fix fontification for else in macro body in rust-ts-mode * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): Add a rule for else in macro body. Also added the same rule for "in" and "move" keyword, as they seems to have the same problem. (cherry picked from commit 07c47ea002b4702285bbf467ec09c9b281eb19b7) --- lisp/progmodes/rust-ts-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 25f1df4a9f9..7bc05898d15 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -213,7 +213,11 @@ to be checked as its standard input." :language 'rust :feature 'keyword - `([,@rust-ts-mode--keywords] @font-lock-keyword-face) + `([,@rust-ts-mode--keywords] @font-lock-keyword-face + ;; If these keyword are in a macro body, they're marked as + ;; identifiers. + ((identifier) @font-lock-keyword-face + (:match ,(rx (or "else" "in" "move")) @font-lock-keyword-face))) :language 'rust :feature 'number -- 2.39.5