Mercurial > vim
comparison src/version.c @ 4170:14698f63de8d v7.3.837
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 26 Feb 2013 15:27:23 +0100 |
parents | ff193256398a |
children | 1c819b05529c |
comparison
equal
deleted
inserted
replaced
4169:043c638a4fd7 | 4170:14698f63de8d |
---|---|
727 }; | 727 }; |
728 | 728 |
729 static int included_patches[] = | 729 static int included_patches[] = |
730 { /* Add new patch number below this line */ | 730 { /* Add new patch number below this line */ |
731 /**/ | 731 /**/ |
732 837, | |
733 /**/ | |
732 836, | 734 836, |
733 /**/ | 735 /**/ |
734 835, | 736 835, |
735 /**/ | 737 /**/ |
736 834, | 738 834, |
2494 msg_putchar('\n'); | 2496 msg_putchar('\n'); |
2495 } | 2497 } |
2496 return; | 2498 return; |
2497 } | 2499 } |
2498 | 2500 |
2499 ncol = (int) Columns / width; | |
2500 /* The rightmost column doesn't need a separator. | 2501 /* The rightmost column doesn't need a separator. |
2501 * Sacrifice it to fit in one more column if possible. */ | 2502 * Sacrifice it to fit in one more column if possible. */ |
2502 if (Columns % width == width - 1) | 2503 ncol = (int) (Columns + 1) / width; |
2503 ncol++; | |
2504 | |
2505 nrow = nfeat / ncol + (nfeat % ncol ? 1 : 0); | 2504 nrow = nfeat / ncol + (nfeat % ncol ? 1 : 0); |
2506 | 2505 |
2506 /* i counts columns then rows. idx counts rows then columns. */ | |
2507 for (i = 0; !got_int && i < nrow * ncol; ++i) | 2507 for (i = 0; !got_int && i < nrow * ncol; ++i) |
2508 { | 2508 { |
2509 int idx = (i / ncol) + (i % ncol) * nrow; | 2509 int idx = (i / ncol) + (i % ncol) * nrow; |
2510 | 2510 |
2511 if (idx < nfeat) | 2511 if (idx < nfeat) |
2523 while (msg_col % width) | 2523 while (msg_col % width) |
2524 msg_putchar(' '); | 2524 msg_putchar(' '); |
2525 } | 2525 } |
2526 } | 2526 } |
2527 else | 2527 else |
2528 msg_putchar('\n'); | 2528 { |
2529 if (msg_col > 0) | |
2530 msg_putchar('\n'); | |
2531 } | |
2529 } | 2532 } |
2530 } | 2533 } |
2531 | 2534 |
2532 void | 2535 void |
2533 list_version() | 2536 list_version() |