diff options
| author | Tom Lane | 2017-06-21 19:35:54 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-06-21 19:35:54 +0000 |
| commit | 382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch) | |
| tree | f558251492f2c6f86e3566f7a82f9d00509122c2 /src/fe_utils | |
| parent | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff) | |
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they
flow past the right margin.
By default, BSD indent lines up statement continuation lines that are
within parentheses so that they start just to the right of the preceding
left parenthesis. However, traditionally, if that resulted in the
continuation line extending to the right of the desired right margin,
then indent would push it left just far enough to not overrun the margin,
if it could do so without making the continuation line start to the left of
the current statement indent. That makes for a weird mix of indentations
unless one has been completely rigid about never violating the 80-column
limit.
This behavior has been pretty universally panned by Postgres developers.
Hence, disable it with indent's new -lpl switch, so that parenthesized
lines are always lined up with the preceding left paren.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/fe_utils')
| -rw-r--r-- | src/fe_utils/mbprint.c | 2 | ||||
| -rw-r--r-- | src/fe_utils/print.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/fe_utils/mbprint.c b/src/fe_utils/mbprint.c index 8db72624d51..9aabe59f38b 100644 --- a/src/fe_utils/mbprint.c +++ b/src/fe_utils/mbprint.c @@ -104,7 +104,7 @@ utf_charcheck(const unsigned char *c) /* check 0xfffe/0xffff, 0xfdd0..0xfedf range, surrogates */ if (((z == 0x0f) && (((yx & 0xffe) == 0xffe) || - (((yx & 0xf80) == 0xd80) && (lx >= 0x30) && (lx <= 0x4f)))) || + (((yx & 0xf80) == 0xd80) && (lx >= 0x30) && (lx <= 0x4f)))) || ((z == 0x0d) && ((yx & 0xb00) == 0x800))) return -1; return 3; diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c index 4f3d9e3afe7..f756f767e57 100644 --- a/src/fe_utils/print.c +++ b/src/fe_utils/print.c @@ -1006,7 +1006,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout, bool is_pager) int bytes_to_output; int chars_to_output = width_wrap[j]; bool finalspaces = (opt_border == 2 || - (col_count > 0 && j < col_count - 1)); + (col_count > 0 && j < col_count - 1)); /* Print left-hand wrap or newline mark */ if (opt_border != 0) @@ -1046,14 +1046,14 @@ print_aligned_text(const printTableContent *cont, FILE *fout, bool is_pager) /* spaces first */ fprintf(fout, "%*s", width_wrap[j] - chars_to_output, ""); fputnbytes(fout, - (char *) (this_line->ptr + bytes_output[j]), + (char *) (this_line->ptr + bytes_output[j]), bytes_to_output); } else /* Left aligned cell */ { /* spaces second */ fputnbytes(fout, - (char *) (this_line->ptr + bytes_output[j]), + (char *) (this_line->ptr + bytes_output[j]), bytes_to_output); } @@ -2360,7 +2360,7 @@ print_latex_longtable_text(const printTableContent *cont, FILE *fout) { fputs("p{", fout); fwrite(next_opt_table_attr_char, strcspn(next_opt_table_attr_char, - LONGTABLE_WHITESPACE), 1, fout); + LONGTABLE_WHITESPACE), 1, fout); last_opt_table_attr_char = next_opt_table_attr_char; next_opt_table_attr_char += strcspn(next_opt_table_attr_char, LONGTABLE_WHITESPACE); @@ -2371,7 +2371,7 @@ print_latex_longtable_text(const printTableContent *cont, FILE *fout) { fputs("p{", fout); fwrite(last_opt_table_attr_char, strcspn(last_opt_table_attr_char, - LONGTABLE_WHITESPACE), 1, fout); + LONGTABLE_WHITESPACE), 1, fout); fputs("\\textwidth}", fout); } else |
