Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Themes use commented-out directives #849

Closed
acidghost opened this issue May 12, 2024 · 0 comments · Fixed by #850
Closed

[BUG] Themes use commented-out directives #849

acidghost opened this issue May 12, 2024 · 0 comments · Fixed by #850
Assignees
Labels
bug Something isn't working

Comments

@acidghost
Copy link
Contributor

The parser for themes does not handle comments properly. It parses commented-out directives as if they were not commented out.

To Reproduce

Using something like the following will set the color to #7323c3, even if the line starts with a '#'.

theme[cpu_start]="#af5fff"
# theme[cpu_start]="#7323c3"

Expected behavior

The color should have been #af5fff.

Cause

This block does not handle comments at all

btop/src/btop_theme.cpp

Lines 383 to 401 in dd4ada7

while (not themefile.bad()) {
themefile.ignore(SSmax, '[');
if (themefile.eof()) break;
string name, value;
getline(themefile, name, ']');
if (not Default_theme.contains(name)) {
continue;
}
themefile.ignore(SSmax, '=');
themefile >> std::ws;
if (themefile.eof()) break;
if (themefile.peek() == '"') {
themefile.ignore(1);
getline(themefile, value, '"');
}
else getline(themefile, value, '\n');
theme_out[name] = value;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants