mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.1.1760: extra line break for wrapping output of :args
Problem: Extra line break for wrapping output of :args. Solution: Avoid the extra line break. (Daniel Hahler, closes #4737)
This commit is contained in:
@@ -777,6 +777,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1760,
|
||||
/**/
|
||||
1759,
|
||||
/**/
|
||||
@@ -4418,11 +4420,11 @@ list_in_columns(char_u **items, int size, int current)
|
||||
|
||||
if (Columns < width)
|
||||
{
|
||||
/* Not enough screen columns - show one per line */
|
||||
// Not enough screen columns - show one per line
|
||||
for (i = 0; i < item_count; ++i)
|
||||
{
|
||||
version_msg_wrap(items[i], i == current);
|
||||
if (msg_col > 0)
|
||||
if (msg_col > 0 && i < item_count - 1)
|
||||
msg_putchar('\n');
|
||||
}
|
||||
return;
|
||||
@@ -4433,7 +4435,7 @@ list_in_columns(char_u **items, int size, int current)
|
||||
ncol = (int) (Columns + 1) / width;
|
||||
nrow = item_count / ncol + (item_count % ncol ? 1 : 0);
|
||||
|
||||
// "i" counts columns then rows. idx counts rows then columns.
|
||||
// "i" counts columns then rows. "idx" counts rows then columns.
|
||||
for (i = 0; !got_int && i < nrow * ncol; ++i)
|
||||
{
|
||||
int idx = (i / ncol) + (i % ncol) * nrow;
|
||||
@@ -4467,9 +4469,12 @@ list_in_columns(char_u **items, int size, int current)
|
||||
else
|
||||
{
|
||||
// this row is out of items, thus at the end of the row
|
||||
if (msg_col > 0 && cur_row < nrow)
|
||||
msg_putchar('\n');
|
||||
++cur_row;
|
||||
if (msg_col > 0)
|
||||
{
|
||||
if (cur_row < nrow)
|
||||
msg_putchar('\n');
|
||||
++cur_row;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user