Skip to content

Commit c809ffc

Browse files
committed
updated for version 7.3.837
Problem: Empty lines in :version output when 'columns' is 320. Solution: Simplify the logic of making columns. (Nazri Ramliy, Roland Eggner)
1 parent 0a29612 commit c809ffc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/version.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
837,
731733
/**/
732734
836,
733735
/**/
@@ -2496,14 +2498,12 @@ list_features()
24962498
return;
24972499
}
24982500

2499-
ncol = (int) Columns / width;
25002501
/* The rightmost column doesn't need a separator.
25012502
* Sacrifice it to fit in one more column if possible. */
2502-
if (Columns % width == width - 1)
2503-
ncol++;
2504-
2503+
ncol = (int) (Columns + 1) / width;
25052504
nrow = nfeat / ncol + (nfeat % ncol ? 1 : 0);
25062505

2506+
/* i counts columns then rows. idx counts rows then columns. */
25072507
for (i = 0; !got_int && i < nrow * ncol; ++i)
25082508
{
25092509
int idx = (i / ncol) + (i % ncol) * nrow;
@@ -2525,7 +2525,10 @@ list_features()
25252525
}
25262526
}
25272527
else
2528-
msg_putchar('\n');
2528+
{
2529+
if (msg_col > 0)
2530+
msg_putchar('\n');
2531+
}
25292532
}
25302533
}
25312534

0 commit comments

Comments
 (0)