pgindent infelicity

Started by Tom Laneover 19 years ago2 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

I notice that the latest pgindent run has decided that comments attached
to "else" should be moved onto the next line, as in this example in
src/bin/psql/mbprint.c:

                        {
                                linewidth += 4;
                                format_size += 4;
                        }
-                       else  /* Output itself */
+                       else
+                               /* Output itself */
                        {
                                linewidth++;
                                format_size += 1;
                        }

I find this pretty ugly; can it be fixed?

regards, tom lane

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgindent infelicity

Tom Lane wrote:

I notice that the latest pgindent run has decided that comments attached
to "else" should be moved onto the next line, as in this example in
src/bin/psql/mbprint.c:

{
linewidth += 4;
format_size += 4;
}
-                       else  /* Output itself */
+                       else
+                               /* Output itself */
{
linewidth++;
format_size += 1;
}

I find this pretty ugly; can it be fixed?

FYI, I fixed this soon after you reported it. It will now only push
down multi-line comments after 'else'.

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +