From 5711adf2b367598b6b11ee9cdbd7350c9197bf95 Mon Sep 17 00:00:00 2001 From: Randy Taylor Date: Tue, 6 Aug 2024 20:10:52 -0400 Subject: [PATCH] Fix cmake-ts-mode number fontification (Bug#72228) * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--constants): Remove "1" and "0". (cmake-ts-mode--font-lock-settings): Match negative numbers. (cherry picked from commit 09d2125a7fd9ac03bc8d381ac275db8f1589f464) --- lisp/progmodes/cmake-ts-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index b70806f4c30..854adf4ade7 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -73,8 +73,7 @@ "Tree-sitter indent rules for `cmake-ts-mode'.") (defvar cmake-ts-mode--constants - '("1" "ON" "TRUE" "YES" "Y" "0" "OFF" "FALSE" "NO" "N" "IGNORE" - "NOTFOUND") + '("ON" "TRUE" "YES" "Y" "OFF" "FALSE" "NO" "N" "IGNORE" "NOTFOUND") "CMake constants for tree-sitter font-locking.") (defvar cmake-ts-mode--keywords @@ -164,7 +163,7 @@ Check if a node type is available, then return the right font lock rules." :language 'cmake :feature 'number '(((unquoted_argument) @font-lock-number-face - (:match "\\`[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+\\'" + (:match "\\`-?[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+\\'" @font-lock-number-face))) :language 'cmake -- 2.39.2