patch 9.1.1626: cindent: does not handle compound literals

Problem:  C-indent does not handle compound literals
          (@44100hertz, @Jorenar)
Solution: Detect and handle compound literal and structure
          initialization (Anttoni Erkkilä)

match '=' or "return" optionally followed by &, (typecast), {
Fixes also initialization which begins with multiple opening braces.

fixes: #2090
fixes: #12491
closes: #17865

Signed-off-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Anttoni Erkkilä
2025-08-12 21:59:06 +02:00
committed by Christian Brabandt
parent 59e1d7f353
commit 5ba6e41d37
4 changed files with 111 additions and 21 deletions

View File

@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 08
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 12
VIM REFERENCE MANUAL by Bram Moolenaar
@ -41736,6 +41736,7 @@ Others: ~
- |gv| works in operator pending mode and does not abort
- The close button shown in the non-GUI 'tabline' will only be visible if the
'mouse' option contains either "a" or any of the flags "n", "v", or "i".
- |C-indenting| handles compound literals.
*added-9.2*
Added ~