From 58a0f7f09142a5eb4a7b20c649dbe45844f8e9ae Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 9 Nov 2014 13:08:09 -0800 Subject: [PATCH] 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. --- pager.cpp | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/pager.cpp b/pager.cpp index c4a6fc058..002479bce 100644 --- a/pager.cpp +++ b/pager.cpp @@ -525,54 +525,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co width = pref_width; 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