From b460f140939023dfa8c7a3a39c1aa3881f819a2e Mon Sep 17 00:00:00 2001
From: Andreas Karlsson <andreas@proxel.se>
Date: Tue, 17 Feb 2026 09:04:01 +0100
Subject: [PATCH v1 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 2622cc6227a..f4ea10c0ba8 100644
--- a/src/tools/pg_bsd_indent/indent.c
+++ b/src/tools/pg_bsd_indent/indent.c
@@ -1012,6 +1012,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

