top: tweaks to vertical scroll management & 'i' toggle

The commit referenced below claims to disable vertical
scrolling when idle tasks weren't being shown. However
it really addresses only a point in time when that 'i'
toggle is keyed. Left untouched were the up/down keys.

So this commit will simply finish the job of disabling
vertical scrolling whenever tasks which have used some
CPU are the only ones which are currently being shown.

Reference(s):
commit c07f6c5e6d

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2016-02-10 00:00:00 -06:00 committed by Craig Small
parent e21cc13c64
commit 656a4980a4

View File

@ -4369,10 +4369,10 @@ static void keys_window (int ch) {
} }
break; break;
case kbd_UP: case kbd_UP:
if (VIZCHKw(w)) if (0 < w->begtask) w->begtask -= 1; if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS) && 0 < w->begtask) w->begtask -= 1;
break; break;
case kbd_DOWN: case kbd_DOWN:
if (VIZCHKw(w)) if (w->begtask < PIDSmaxt -1) w->begtask += 1; if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS) && (w->begtask < PIDSmaxt -1)) w->begtask += 1;
break; break;
#ifdef USE_X_COLHDR // ------------------------------------ #ifdef USE_X_COLHDR // ------------------------------------
case kbd_LEFT: case kbd_LEFT: