]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix cmake-ts-mode number fontification (Bug#72228)
authorRandy Taylor <dev@rjt.dev>
Wed, 7 Aug 2024 00:10:52 +0000 (20:10 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 11 Aug 2024 07:29:16 +0000 (09:29 +0200)
* 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

index b70806f4c30e67a00a3032029b5a88be222ab261..854adf4ade7e4415886a67437d00a5e028b78efc 100644 (file)
@@ -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