Move treeView setting to make status bar item correct when using --sort-key, patch from @cgzones

Closes #340
This commit is contained in:
Daniel Lange 2020-11-24 15:51:53 +01:00
parent 952ee9cd77
commit 95f553b10c
1 changed files with 5 additions and 5 deletions

10
htop.c
View File

@ -298,6 +298,11 @@ int main(int argc, char** argv) {
settings->highlightChanges = true;
if (flags.highlightDelaySecs != -1)
settings->highlightDelaySecs = flags.highlightDelaySecs;
if (flags.sortKey > 0) {
settings->sortKey = flags.sortKey;
settings->treeView = false;
settings->direction = 1;
}
CRT_init(settings->delay, settings->colorScheme, flags.allowUnicode);
@ -306,11 +311,6 @@ int main(int argc, char** argv) {
MainPanel_updateTreeFunctions(panel, settings->treeView);
if (flags.sortKey > 0) {
settings->sortKey = flags.sortKey;
settings->treeView = false;
settings->direction = 1;
}
ProcessList_printHeader(pl, Panel_getHeader((Panel*)panel));
State state = {