Re: pgindent and line length - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pgindent and line length
Date
Msg-id 201101250302.p0P32Y911232@momjian.us
Whole thread Raw
In response to pgindent and line length  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: pgindent and line length  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Peter Eisentraut wrote:
> Somehow, pgindent appears to have this approach to push lines that are
> longer than the defined line length limit back to the left to make it
> fit.  That results in something like this:
> 
>     printfPQExpBuffer(&buf,
>                       "SELECT n.nspname as \"%s\",\n"
>                       "  p.proname AS \"%s\",\n"
>                  "  pg_catalog.format_type(p.prorettype, NULL) AS \"%s\",\n",
>                       gettext_noop("Schema"),
>                       gettext_noop("Name"),
>                       gettext_noop("Result data type"));
> 
> where the third line of the string was moved to the left.
> 
> I don't think this behavior is useful.  If the line is too long and
> cannot be split, then it is still more useful to be able locate the
> start of the line in an expected position than to have the end of the
> line on the hypothetical screen.  You'll have to scroll right anyway
> because there are usually lines that are going to be too long anyway.
> 
> Can we get rid of this behavior?

I think we will have to switch to another indent binary to do that
because it is done by BSD indent and I can't think of a way of fixing it
with pre or post processing.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Richard Broersma
Date:
Subject: Re: Seeking Mentors for Funded Reviewers
Next
From: Tom Lane
Date:
Subject: Re: pgindent and line length