Better handle deeply nested help highlighting.

This commit is contained in:
Sage Vaillancourt 2022-03-22 12:01:20 -04:00 committed by Sage Vaillancourt
parent 86f3f4b32c
commit bf2b9504a6
1 changed files with 2 additions and 2 deletions

View File

@ -284,10 +284,10 @@ char* getHelp(const char* symbol)
while(test[c]) { while(test[c]) {
if (test[c] == '(') { if (test[c] == '(') {
depth += 1; depth += 1;
textCursor += sprintf(textCursor, "[3%dm", depth + 2); textCursor += sprintf(textCursor, "[3%dm", (depth % 6) + 2);
} else if (test[c] == ')') { } else if (test[c] == ')') {
depth -= 1; depth -= 1;
textCursor += sprintf(textCursor, ")[3%dm", depth + 2); textCursor += sprintf(textCursor, ")[3%dm", (depth % 6) + 2);
c++; c++;
continue; continue;
} }