Skip to content

Commit 2cfea7a

Browse files
committed
Reflect the "show cached memory" setting in help screen
Hide the "buffers/cache" text on the memory bar description when the "show cached memory" setting is off. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
1 parent 3689f05 commit 2cfea7a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Action.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,9 +744,13 @@ static Htop_Reaction actionHelp(State* st) {
744744
addbartext(CRT_colors[MEMORY_USED], "", "used");
745745
addbartext(CRT_colors[MEMORY_SHARED], "/", "shared");
746746
addbartext(CRT_colors[MEMORY_COMPRESSED], "/", "compressed");
747-
addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers");
748-
addbartext(CRT_colors[MEMORY_CACHE], "/", "cache");
749-
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
747+
if (st->host->settings->showCachedMemory) {
748+
addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers");
749+
addbartext(CRT_colors[MEMORY_CACHE], "/", "cache");
750+
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
751+
} else {
752+
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
753+
}
750754
addbartext(CRT_colors[BAR_SHADOW], "/", "total");
751755
addattrstr(CRT_colors[BAR_BORDER], "]");
752756

0 commit comments

Comments
 (0)