Don't show "and 1 more rows" in pager if that requires a row

This commit is contained in:
ridiculousfish 2014-08-11 09:55:07 -07:00
parent cb480dddf6
commit ede3d422a0

View file

@ -464,6 +464,13 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co
{ {
rendering->remaining_to_disclose = 0; rendering->remaining_to_disclose = 0;
} }
/* If we have only one row remaining to disclose, then squelch the comment row. This prevents us from consuming a line to show "...and 1 more row" */
if (! this->fully_disclosed && rendering->remaining_to_disclose == 1)
{
term_height += 1;
rendering->remaining_to_disclose = 0;
}
int pref_tot_width=0; int pref_tot_width=0;
int min_tot_width = 0; int min_tot_width = 0;