Commit 99a93dae authored by Alan Mackenzie's avatar Alan Mackenzie

Correctly indent C++ brace lists in member init lists.

* lisp/progmodes/cc-engine.el (c-guess-basic-syntax; CASE 9B, CASE 9C): Set a
limit for a backward search to the ":" introducing the member init list, when
there is one, rather than the enclosing "{" or nil.
parent a8f2d97b
......@@ -12607,7 +12607,11 @@ comment at the start of cc-engine.el for more info."
(= (point) containing-sexp)))
(if (eq (point) (c-point 'boi))
(c-add-syntax 'brace-list-close (point))
(setq lim (c-most-enclosing-brace state-cache (point)))
(setq lim (or (save-excursion
(and
(c-back-over-member-initializers)
(point)))
(c-most-enclosing-brace state-cache (point))))
(c-beginning-of-statement-1 lim nil nil t)
(c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
......@@ -12636,7 +12640,11 @@ comment at the start of cc-engine.el for more info."
(goto-char containing-sexp))
(if (eq (point) (c-point 'boi))
(c-add-syntax 'brace-list-intro (point))
(setq lim (c-most-enclosing-brace state-cache (point)))
(setq lim (or (save-excursion
(and
(c-back-over-member-initializers)
(point)))
(c-most-enclosing-brace state-cache (point))))
(c-beginning-of-statement-1 lim)
(c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment