On Mon, Jan 28, 2019 at 8:08 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Mon, Jan 28, 2019 at 12:28:30AM -0500, Tom Lane wrote:
> > Thomas Munro <thomas.munro@enterprisedb.com> writes:
> >> That's ... annoying. I wish indent wouldn't do that, because it means
> >> that my declarations get moved around every time I write code.
> >
> > If you can fix it, I'd vote for accepting the patch. I don't personally
> > have the desire to dig into the indent code that much ...
>
> If you could get pgindent smarter in this area, it would be really
> nice..
Ah, it's not indent doing it, it's pgindent's post_indent subroutine
trying to correct the effects of the (implied) -psl option, but not
doing a complete job of it (it should adjust the indentation lines of
later lines if it changes the first line).
One idea I had was to tell indent not to do that by using -npsl when
processing headers, like in the attached. That fixes all the headers
I looked at, though of course it doesn't fix the static function
declarations that appear in .c files, so it's not quite the right
answer.
--
Thomas Munro
http://www.enterprisedb.com