commit 22e73a5793872b0dacacd9204353142227870bd2
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Thu Feb 9 13:13:04 2023 -0500

    Fix indentation of multi-line variable initialization expressions.
    
    Lines after the first will now be indented one stop compared to
    the variable declaration itself.  They used to be indented the
    same amount, which was ugly.
    
    Thomas Munro and Tom Lane
    
    Discussion: https://postgr.es/m/20230120013137.7ky7nl4e4zjorrfa@awork3.anarazel.de

diff --git a/src/tools/pg_bsd_indent/io.c b/src/tools/pg_bsd_indent/io.c
index 4149424294..9d64ca1ee5 100644
--- a/src/tools/pg_bsd_indent/io.c
+++ b/src/tools/pg_bsd_indent/io.c
@@ -201,11 +201,12 @@ dump_line(void)
     ps.decl_on_line = ps.in_decl;	/* if we are in the middle of a
 					 * declaration, remember that fact for
 					 * proper comment indentation */
-    ps.ind_stmt = ps.in_stmt & ~ps.in_decl;	/* next line should be
-						 * indented if we have not
-						 * completed this stmt and if
-						 * we are not in the middle of
-						 * a declaration */
+    /* next line should be indented if we have not completed this stmt, and
+     * either we are not in a declaration or we are in an initialization
+     * assignment; but not if we're within braces in an initialization,
+     * because that scenario is handled by other rules. */
+    ps.ind_stmt = ps.in_stmt &&
+	(!ps.in_decl || (ps.block_init && ps.block_init_level <= 0));
     ps.use_ff = false;
     ps.dumped_decl_indent = 0;
     *(e_lab = s_lab) = '\0';	/* reset buffers */
