aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/cc-fonts.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 60b8b6db3cc..bf8b857ca6e 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1654,8 +1654,13 @@ casts and declarations are fontified. Used on level 2 and higher."
1654 (c-forward-syntactic-ws))) 1654 (c-forward-syntactic-ws)))
1655 (c-backward-token-2))) 1655 (c-backward-token-2)))
1656 1656
1657 ;; Go round the following loop once per captured item. 1657 ;; Go round the following loop once per captured item. We use "\\s)"
1658 (while (and (not (eq (char-after) ?\])) 1658 ;; rather than "\\]" here to avoid infinite looping in this situation:
1659 ;; "unsigned items [] { [ }". The second "[" triggers this function,
1660 ;; but if we don't match the "}" with an "\\s)", the
1661 ;; `c-syntactic-re-search-forward' at the end of the loop fails to
1662 ;; move forward over it, leaving point stuck at the "}".
1663 (while (and (not (looking-at "\\s)"))
1659 (< (point) limit)) 1664 (< (point) limit))
1660 (if (eq (char-after) ?&) 1665 (if (eq (char-after) ?&)
1661 (progn (setq mode ?&) 1666 (progn (setq mode ?&)
@@ -1704,7 +1709,8 @@ casts and declarations are fontified. Used on level 2 and higher."
1704 (c-forward-syntactic-ws))) 1709 (c-forward-syntactic-ws)))
1705 1710
1706 (setq capture-default nil) 1711 (setq capture-default nil)
1707 (forward-char)))) ; over the terminating "]". 1712 (if (< (point) limit)
1713 (forward-char))))) ; over the terminating "]" or other close paren.
1708 nil) 1714 nil)
1709 1715
1710 1716