Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8266e8a

Browse files
committed
OK, now pgindent has blank lines before comment blocks, except when
there is a brace on the line above it.
1 parent2d7795e commit8266e8a

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

‎src/tools/pgindent/pgindent

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ thenecho "You appear to have GNU indent rather than BSD indent." >&2
1919
echo"See the pgindent/README file for a description of its problems.">&2
2020
EXTRA_OPTS="-ncdb -bli0 -npcs -cli4"
2121
elseecho"Hope you installed /src/tools/pgindent/indent.bsd.patch.">&2
22-
EXTRA_OPTS="-cli1"
22+
EXTRA_OPTS="-bbb -cli1"
2323
fi
2424

2525
for FILE
@@ -1343,6 +1343,36 @@ do
13431343
if (skips <= 2)
13441344
print line2;
13451345
}'|
1346+
# remove blank line between opening brace and block comment
1347+
awk'
1348+
{
1349+
line3 = $0;
1350+
if (skips > 0)
1351+
skips--;
1352+
if (line1 ~ "*{$" &&
1353+
line2 ~ "^$" &&
1354+
line3 ~ "*/\\*$")
1355+
{
1356+
print line1;
1357+
print line3;
1358+
line1 = "";
1359+
line2 = "";
1360+
line3 = "";
1361+
skips = 3;
1362+
}
1363+
else
1364+
if (skips == 0 && NR >= 3)
1365+
print line1;
1366+
line1 = line2;
1367+
line2 = line3;
1368+
line3 = "";
1369+
}
1370+
END {
1371+
if (skips <= 1)
1372+
print line1;
1373+
if (skips <= 2)
1374+
print line2;
1375+
}'|
13461376
# Move prototype names to the same line as return type. Useful for ctags.
13471377
# Indent should do this, but it does not. It formats prototypes just
13481378
# like real functions.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp