Remove "squeezing" code in pager

The "squeezing" code attempted to force completions to fit
onto a single screen, but could render them unreadable.
Let's just get rid of it.
This commit is contained in:
ridiculousfish 2014-11-09 13:08:09 -08:00
parent 09bac97bb4
commit 58a0f7f091

View file

@ -525,54 +525,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co
width = pref_width; width = pref_width;
print = true; print = true;
} }
else
{
long next_rows = (lst.size()-1)/(cols-1)+1;
/* fwprintf( stderr,
L"cols %d, min_tot %d, term %d, rows=%d, nextrows %d, termrows %d, diff %d\n",
cols,
min_tot_width, term_width,
rows, next_rows, term_height,
pref_tot_width-term_width );
*/
if (min_tot_width < term_width &&
(((row_count < term_height) && (next_rows >= term_height)) ||
(pref_tot_width-term_width< 4 && cols < 3)))
{
/*
Terminal almost wide enough, or squeezing makes the
whole list fit on-screen.
This part of the code is really important. People hate
having to scroll through the completion list. In cases
where there are a huge number of completions, it can't
be helped, but it is not uncommon for the completions to
_almost_ fit on one screen. In those cases, it is almost
always desirable to 'squeeze' the completions into a
single page.
If we are using N columns and can get everything to
fit using squeezing, but everything would also fit
using N-1 columns, don't try.
*/
int tot_width = min_tot_width;
width = min_width;
while (tot_width < term_width)
{
for (long i=0; (i<cols) && (tot_width < term_width); i++)
{
if (width[i] < pref_width[i])
{
width[i]++;
tot_width++;
}
}
}
print = true;
}
}
if (print) if (print)
{ {