v1-0001-Make-pgindent-add-a-space-between-comma-and-perio.patch
text/x-patch
Filename: v1-0001-Make-pgindent-add-a-space-between-comma-and-perio.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: Make pgindent add a space between comma and period
| File | + | − |
|---|---|---|
| src/tools/pg_bsd_indent/indent.c | 2 | 0 |
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