From 50f72461e93f1503ba927666e62ec8c49365f936 Mon Sep 17 00:00:00 2001
From: Andreas Karlsson <andreas@proxel.se>
Date: Tue, 17 Feb 2026 09:04:01 +0100
Subject: [PATCH v3 1/2] Make pgindent add a space between comma and period

Formatting of varidic functions and struct literals with named field
used to be ugly due to pgindent treaing period as always being binary
operator for struct access, but after comma it has a different meaning.
---
 src/tools/pg_bsd_indent/indent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tools/pg_bsd_indent/indent.c b/src/tools/pg_bsd_indent/indent.c
index 421592db928..58fa04293d9 100644
--- a/src/tools/pg_bsd_indent/indent.c
+++ b/src/tools/pg_bsd_indent/indent.c
@@ -1013,6 +1013,8 @@ check_type:
 
 	case period:		/* treat a period kind of like a binary
 				 * operation */
+	    if (ps.want_blank && ps.last_token == comma)
+	        *e_code++ = ' ';
 	    *e_code++ = '.';	/* move the period into line */
 	    ps.want_blank = false;	/* dont put a blank after a period */
 	    break;
-- 
2.47.3

