Fix c-ts-mode bsd-style indentation of union bodies (bug#81255)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--simple-indent-rules): Add
"union_specifier" to the parent-is regexp.

* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: New test.
This commit is contained in:
समीर सिंह Sameer Singh 2026-06-17 16:56:12 +05:30 committed by Yuan Fu
parent 9d1b0c2d7f
commit c0a33a474d
No known key found for this signature in database
GPG key ID: 56E19BC57664A442
2 changed files with 10 additions and 0 deletions

View file

@ -501,6 +501,7 @@ MODE can be `c' or `cpp'. STYLE can be `gnu', `k&r', `linux', `bsd'."
((parent-is ,(rx (or "function_definition"
"struct_specifier"
"enum_specifier"
"union_specifier"
"function_declarator"
"template_declaration")))
standalone-parent 0)

View file

@ -125,3 +125,12 @@ if (true)
else
break;
=-=-=
Name: Union (bug#81255)
=-=
union u
{
int i;
};
=-=-=