htop: fix order or header_columns setting (#2435)

When `header_columns` is in settings it must appear before any of the
`column_meters_*` options.

Fixes 2426.
This commit is contained in:
Bart Bakker 2021-11-01 19:27:29 +00:00 committed by GitHub
parent 275f955db9
commit 7523252f97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 3 deletions

View file

@ -170,9 +170,18 @@ in {
];
};
before = optionalAttrs (cfg.settings ? header_layout) {
inherit (cfg.settings) header_layout;
};
settings = defaults // (removeAttrs cfg.settings (attrNames before));
formatOptions = mapAttrsToList formatOption;
in mkIf (cfg.settings != { }) {
text = concatStringsSep "\n"
(mapAttrsToList formatOption (defaults // cfg.settings)) + "\n";
text =
concatStringsSep "\n" (formatOptions before ++ formatOptions settings)
+ "\n";
};
};
}