From bf2b9504a6f349dd94a715e5e855f718f937bbdc Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Tue, 22 Mar 2022 12:01:20 -0400 Subject: [PATCH] Better handle deeply nested help highlighting. --- src/env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env.c b/src/env.c index fbd7967..af9fd34 100644 --- a/src/env.c +++ b/src/env.c @@ -284,10 +284,10 @@ char* getHelp(const char* symbol) while(test[c]) { if (test[c] == '(') { depth += 1; - textCursor += sprintf(textCursor, "[3%dm", depth + 2); + textCursor += sprintf(textCursor, "[3%dm", (depth % 6) + 2); } else if (test[c] == ')') { depth -= 1; - textCursor += sprintf(textCursor, ")[3%dm", depth + 2); + textCursor += sprintf(textCursor, ")[3%dm", (depth % 6) + 2); c++; continue; }