From 5b629f76117c999424965df4446627b32b4c1056 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sun, 14 Apr 2024 08:21:56 +0000 Subject: [PATCH] CC Mode: Don't start fontifying in the middle of an identifier This fixes bug#70367. * lisp/progmodes/cc-mode.el (c-fl-decl-start): After searching backwards for the end of the previous statement, check whether or not we found it. (cherry picked from commit b2842b25bf7fc934cf86b82d1053db55fd55c00b) --- lisp/progmodes/cc-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 1a9d0907bd0..5f11622733f 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2463,7 +2463,7 @@ with // and /*, not more generic line and block comments." (backward-char) (setq pseudo (c-cheap-inside-bracelist-p (c-parse-state))))))) (goto-char pseudo)) - t) + (or pseudo (> (point) bod-lim))) ;; Move forward to the start of the next declaration. (progn (c-forward-syntactic-ws) ;; Have we got stuck in a comment at EOB? -- 2.39.5