diff --git a/config.yml b/config.yml index 8f079ce..786204f 100644 --- a/config.yml +++ b/config.yml @@ -9,8 +9,8 @@ # maxFPS: 30 # general: - maxFPS: 30 - theme: bad + maxFPS: 30 + theme: bad ############################# # # diff --git a/src/configManagement.cpp b/src/configManagement.cpp index cef80f3..a5ac6d6 100644 --- a/src/configManagement.cpp +++ b/src/configManagement.cpp @@ -45,12 +45,14 @@ void ConfigBuilder::parseFile(const string& fname) { vector keyParts; unsigned listIndex; + unsigned lineno = 0; // for error handling purposes while (!file.eof()) { string line; getline(file, line); + ++lineno; auto match = line.find('#'); if (match != string::npos)line.erase(match); - if (line.empty())continue; + if (line.find_first_not_of(' ')==string::npos)continue; unsigned currentIndent = 0; while (line[currentIndent] == ' ')++currentIndent; @@ -71,7 +73,7 @@ void ConfigBuilder::parseFile(const string& fname) { }else{ match = line.find(':'); - if (match == string::npos)throw config_error("Line "+ to_string(currentIndent)+" invalid : |"+line+"|"); + if (match == string::npos)throw config_error("Line "+ to_string(lineno)+" invalid : |"+line+"|"); string key = line.substr(0, match); string value = line.substr(match + 1); trimSpaces(key);