top: treat all of those vertical scroll keys uniformly

When not displaying all tasks (the 'i' toggle is off),
the concept of vertical scrolling has no real meaning.

However, only 2 keys (up/down) impacting that vertical
position were currently being disabled with this mode.

This patch will extend such treatment to the following
additional vertical impact keys: pgup,pgdn,home & end.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2018-06-07 00:00:00 -05:00 committed by Craig Small
parent 19ec80bd41
commit 5705866fb6

View File

@ -4694,7 +4694,7 @@ static void keys_window (int ch) {
if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS) && 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 (CHKw(w, Show_IDLEPS) && (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:
@ -4762,33 +4762,39 @@ static void keys_window (int ch) {
break; break;
#endif // USE_X_COLHDR ------------------------------------ #endif // USE_X_COLHDR ------------------------------------
case kbd_PGUP: case kbd_PGUP:
if (VIZCHKw(w)) if (0 < w->begtask) { if (VIZCHKw(w)) {
if (CHKw(w, Show_IDLEPS) && 0 < w->begtask) {
w->begtask -= (w->winlines - 1); w->begtask -= (w->winlines - 1);
if (0 > w->begtask) w->begtask = 0; if (0 > w->begtask) w->begtask = 0;
} }
}
break; break;
case kbd_PGDN: case kbd_PGDN:
if (VIZCHKw(w)) if (w->begtask < PIDSmaxt -1) { if (VIZCHKw(w)) {
if (CHKw(w, Show_IDLEPS) && w->begtask < PIDSmaxt - 1) {
w->begtask += (w->winlines - 1); w->begtask += (w->winlines - 1);
if (w->begtask > PIDSmaxt -1) w->begtask = PIDSmaxt -1; if (w->begtask > PIDSmaxt - 1) w->begtask = PIDSmaxt - 1;
if (0 > w->begtask) w->begtask = 0; if (0 > w->begtask) w->begtask = 0;
} }
}
break; break;
case kbd_HOME: case kbd_HOME:
#ifndef SCROLLVAR_NO #ifndef SCROLLVAR_NO
if (VIZCHKw(w)) w->begtask = w->begpflg = w->varcolbeg = 0; if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS)) w->begtask = w->begpflg = w->varcolbeg = 0;
#else #else
if (VIZCHKw(w)) w->begtask = w->begpflg = 0; if (VIZCHKw(w)) if (CHKw(w, Show_IDLEPS)) w->begtask = w->begpflg = 0;
#endif #endif
break; break;
case kbd_END: case kbd_END:
if (VIZCHKw(w)) { if (VIZCHKw(w)) {
w->begtask = (PIDSmaxt - w->winlines) +1; if (CHKw(w, Show_IDLEPS)) {
if (0 > w->begtask) w->begtask = 0; w->begtask = (PIDSmaxt - w->winlines) + 1;
w->begpflg = w->endpflg; if (0 > w->begtask) w->begtask = 0;
w->begpflg = w->endpflg;
#ifndef SCROLLVAR_NO #ifndef SCROLLVAR_NO
w->varcolbeg = 0; w->varcolbeg = 0;
#endif #endif
}
} }
break; break;
default: // keep gcc happy default: // keep gcc happy