]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: fontify variables/functions after line comments ending in spaces
authorAlan Mackenzie <acm@muc.de>
Fri, 29 Jul 2022 20:18:58 +0000 (20:18 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 29 Jul 2022 20:18:58 +0000 (20:18 +0000)
* lisp/progmodes/cc-engine.el (c-forward-comment-minus-1): Take account of
spaces preceding a linefeed when scanning a putative line comment end.

lisp/progmodes/cc-engine.el

index 3068c41a57e3bb4d0451765267224e42e862bde4..80ac496749c2a6cfa0a5076125f2643b6dfb8f34 100644 (file)
@@ -1668,9 +1668,13 @@ comment at the start of cc-engine.el for more info."
 Return the result of `forward-comment' if it gets called, nil otherwise."
   `(if (not comment-end-can-be-escaped)
        (forward-comment -1)
-     (when (and (< (skip-syntax-backward " >") 0)
-               (eq (char-after) ?\n))
-       (forward-char))
+     (let ((dist (skip-syntax-backward " >")))
+       (when (and
+             (< dist 0)
+             (progn
+               (skip-syntax-forward " " (- (point) dist 1))
+               (eq (char-after) ?\n)))
+        (forward-char)))
      (cond
       ((and (eq (char-before) ?\n)
            (eq (char-before (1- (point))) ?\\))