indent(1): better alignment of comments on code.
If aligning the beginning of a comment to -cn would mean no space between code and the comment, align it to the next tab stop.
This commit is contained in:
parent
90ea34bf97
commit
3e2c1447d5
@ -141,7 +141,7 @@ pr_comment(void)
|
||||
target_col = count_spaces(compute_label_target(), s_lab);
|
||||
}
|
||||
ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind;
|
||||
if (ps.com_col < target_col)
|
||||
if (ps.com_col <= target_col)
|
||||
ps.com_col = ((target_col + 7) & ~7) + 1;
|
||||
if (ps.com_col + 24 > adj_max_col)
|
||||
adj_max_col = ps.com_col + 24;
|
||||
|
@ -1,4 +1,11 @@
|
||||
/* $FreeBSD$ */
|
||||
typedef enum x {
|
||||
aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */
|
||||
bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */
|
||||
cccccccccccccc = 1 << 1, /* test c */
|
||||
dddddddddddddddddddddddddddddd = 1 << 2 /* test d */
|
||||
} x;
|
||||
|
||||
/* See r303597, r303598, r309219, and r309343 */
|
||||
void t(void) {
|
||||
/*
|
||||
|
@ -1,4 +1,11 @@
|
||||
/* $FreeBSD$ */
|
||||
typedef enum x {
|
||||
aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */
|
||||
bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */
|
||||
cccccccccccccc = 1 << 1, /* test c */
|
||||
dddddddddddddddddddddddddddddd = 1 << 2 /* test d */
|
||||
} x;
|
||||
|
||||
/* See r303597, r303598, r309219, and r309343 */
|
||||
void
|
||||
t(void)
|
||||
|
Loading…
Reference in New Issue
Block a user