]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Don't start fontifying in the middle of an identifier
authorAlan Mackenzie <acm@muc.de>
Sun, 14 Apr 2024 08:21:56 +0000 (08:21 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Apr 2024 17:11:37 +0000 (19:11 +0200)
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

index 1a9d0907bd0eab1e5dcf867573ba134739d5d1e3..5f11622733fc5fe552a49aa17f47da37c36ab01e 100644 (file)
@@ -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?