hotfix to prevent accidental highlighting of numbers as macros

Sun, 02 Mar 2025 12:47:31 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 02 Mar 2025 12:47:31 +0100
changeset 90
98adda6171d1
parent 89
71fd1413d7bb
child 91
2c8514b3891b

hotfix to prevent accidental highlighting of numbers as macros

relates to #393

src/highlighter.c file | annotate | diff | comparison | revisions
--- a/src/highlighter.c	Sun Mar 02 12:41:09 2025 +0100
+++ b/src/highlighter.c	Sun Mar 02 12:47:31 2025 +0100
@@ -63,7 +63,10 @@
 }
 
 static int check_capsonly(cxstring word) {
-    for (size_t i = 0 ; i < word.length ; i++) {
+    if (!isupper(word.ptr[0]) && word.ptr[0] != '_') {
+        return 0;
+    }
+    for (size_t i = 1 ; i < word.length ; i++) {
         if (!isupper(word.ptr[i]) && !isdigit(word.ptr[i])
                 && word.ptr[i] != '_') {
             return 0;

mercurial