Skip to content

Commit

Permalink
Reflect the "show cached memory" setting in help screen
Browse files Browse the repository at this point in the history
Hide the "buffers/cache" text on the memory bar description when the
"show cached memory" setting is off.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Jan 9, 2025
1 parent 4e6a781 commit cdd6c98
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Action.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,13 @@ static Htop_Reaction actionHelp(State* st) {
addbartext(CRT_colors[MEMORY_USED], "", "used");
addbartext(CRT_colors[MEMORY_SHARED], "/", "shared");
addbartext(CRT_colors[MEMORY_COMPRESSED], "/", "compressed");
addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers");
addbartext(CRT_colors[MEMORY_CACHE], "/", "cache");
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
if (st->host->settings->showCachedMemory) {
addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers");
addbartext(CRT_colors[MEMORY_CACHE], "/", "cache");
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
} else {
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
}
addbartext(CRT_colors[BAR_SHADOW], "/", "total");
addattrstr(CRT_colors[BAR_BORDER], "]");

Expand Down

0 comments on commit cdd6c98

Please sign in to comment.