vim-patch:9.1.1626: cindent: does not handle compound literals (#35319)

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: vim/vim#2090
fixes: vim/vim#12491
closes: vim/vim#17865

5ba6e41d37

Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
This commit is contained in:
zeertzjq
2025-08-13 07:21:09 +08:00
committed by GitHub
parent 50ceac4054
commit 35be59cc7b
3 changed files with 111 additions and 26 deletions

View File

@@ -262,6 +262,10 @@ preprocess_patch() {
LC_ALL=C sed -Ee 's/( [ab]\/src\/nvim)\/evalwindow\.c/\1\/eval\/window.c/g' \
"$file" > "$file".tmp && mv "$file".tmp "$file"
# Rename cindent.c to indent_c.c
LC_ALL=C sed -Ee 's/( [ab]\/src\/nvim)\/cindent\.c/\1\/indent_c.c/g' \
"$file" > "$file".tmp && mv "$file".tmp "$file"
# Rename map.c to mapping.c
LC_ALL=C sed -Ee 's/( [ab]\/src\/nvim)\/map\.c/\1\/mapping.c/g' \
"$file" > "$file".tmp && mv "$file".tmp "$file"