top: new #define added for focus ('F') toggle tweaking
Just to see if I could, the new #define will force the indentation of a parent task to be reset to zero while maintaining the proper child indentation relationship. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
37a4601882
commit
c23d2708d4
10
top/top.c
10
top/top.c
@ -4478,7 +4478,8 @@ static void forest_begin (WIN_t *q) {
|
|||||||
* But, if the pid can no longer be found, he'll turn off focus! | */
|
* But, if the pid can no longer be found, he'll turn off focus! | */
|
||||||
static void forest_config (WIN_t *q) {
|
static void forest_config (WIN_t *q) {
|
||||||
// tailored 'results stack value' extractor macro
|
// tailored 'results stack value' extractor macro
|
||||||
#define rSv(x) PID_VAL(eu_TREE_LVL, s_int, q->ppt[(x)])
|
// (TREE_FOCUS_X can't use PID_VAL w/ assignment)
|
||||||
|
#define rSv(x) q->ppt[x]->head[eu_TREE_LVL].result.s_int
|
||||||
int i, level;
|
int i, level;
|
||||||
|
|
||||||
for (i = 0; i < PIDSmaxt; i++) {
|
for (i = 0; i < PIDSmaxt; i++) {
|
||||||
@ -4491,8 +4492,15 @@ static void forest_config (WIN_t *q) {
|
|||||||
if (i == PIDSmaxt)
|
if (i == PIDSmaxt)
|
||||||
q->focus_pid = q->begtask = 0;
|
q->focus_pid = q->begtask = 0;
|
||||||
else {
|
else {
|
||||||
|
#ifdef TREE_FOCUS_X
|
||||||
|
int j = rSv(i);
|
||||||
|
rSv(i) = 0;
|
||||||
|
while (i+1 < PIDSmaxt && rSv(i+1) > level)
|
||||||
|
rSv(++i) -= j;
|
||||||
|
#else
|
||||||
while (i+1 < PIDSmaxt && rSv(i+1) > level)
|
while (i+1 < PIDSmaxt && rSv(i+1) > level)
|
||||||
++i;
|
++i;
|
||||||
|
#endif
|
||||||
q->focus_end = i + 1; // make 'focus_end' a proper fencpost
|
q->focus_end = i + 1; // make 'focus_end' a proper fencpost
|
||||||
}
|
}
|
||||||
#undef rSv
|
#undef rSv
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
//#define TERMIOS_ONLY /* just limp along with native input only */
|
//#define TERMIOS_ONLY /* just limp along with native input only */
|
||||||
//#define TOG4_NOFORCE /* no force 2 abreast mode with '4' toggle */
|
//#define TOG4_NOFORCE /* no force 2 abreast mode with '4' toggle */
|
||||||
//#define TOG4_NOTRUNC /* ensure no truncation in 2 abreast mode */
|
//#define TOG4_NOTRUNC /* ensure no truncation in 2 abreast mode */
|
||||||
|
//#define TREE_FOCUS_X /* 'F' resets forest view indentation to 0 */
|
||||||
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
|
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
|
||||||
//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
|
//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
|
||||||
//#define TREE_VALTMRK /* use an indented '+' with collapsed pids */
|
//#define TREE_VALTMRK /* use an indented '+' with collapsed pids */
|
||||||
|
Loading…
Reference in New Issue
Block a user