]> granicus.if.org Git - procps-ng/commit
top: fix initial cursor position for fields management
authorJim Warner <james.warner@comcast.net>
Sat, 19 Mar 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 21 Mar 2022 10:13:46 +0000 (21:13 +1100)
commit8a5f3f7b265548580df1804b9d64c97b28a1edad
tree9a143dfdd781112d5e03640050d3b7354f26ca00
parent6c356954851d558437bb89fc3f59dafe11023cfb
top: fix initial cursor position for fields management

When we transitioned from 'char' based fields to 'int'
proper initial cursor positioning (highlight) was lost
in the 'fields_utility' function. The highlight should
appear on the current sort field. Instead, however, it
was often positioned on the first field listed or some
completely different field other than that sort field.

So this patch will restore the master branch behavior.

[ and on the assumption that a sort field is visible ]
[ we will search first for a field with the 'on' bit ]

Reference(s):
. Mar, 2022 - trade 'char' for 'int'
commit 46aa96e438435628810b33d20cb1c14dc33dd84f

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h