mirror of
https://github.com/Trensa-Organization/Hyprland.git
synced 2025-03-16 03:03:40 +01:00
Fix trailing spaces in config
This commit is contained in:
parent
655c038417
commit
24316f2e71
3 changed files with 18 additions and 3 deletions
|
@ -82,6 +82,7 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto& CONFIGENTRY = configValues.at(COMMAND);
|
auto& CONFIGENTRY = configValues.at(COMMAND);
|
||||||
if (CONFIGENTRY.intValue != -1) {
|
if (CONFIGENTRY.intValue != -1) {
|
||||||
try {
|
try {
|
||||||
|
@ -271,8 +272,9 @@ void CConfigManager::parseLine(std::string& line) {
|
||||||
if (EQUALSPLACE == std::string::npos)
|
if (EQUALSPLACE == std::string::npos)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto COMMAND = line.substr(0, EQUALSPLACE);
|
const auto COMMAND = removeBeginEndSpacesTabs(line.substr(0, EQUALSPLACE));
|
||||||
const auto VALUE = line.substr(EQUALSPLACE + 1);
|
const auto VALUE = removeBeginEndSpacesTabs(line.substr(EQUALSPLACE + 1));
|
||||||
|
//
|
||||||
|
|
||||||
if (COMMAND == "exec") {
|
if (COMMAND == "exec") {
|
||||||
if (isFirstLaunch) {
|
if (isFirstLaunch) {
|
||||||
|
|
|
@ -61,4 +61,16 @@ void scaleBox(wlr_box* box, float scale) {
|
||||||
box->height = std::round((box->y + box->height) * scale) - std::round(box->y * scale);
|
box->height = std::round((box->y + box->height) * scale) - std::round(box->y * scale);
|
||||||
box->x = std::round(box->x * scale);
|
box->x = std::round(box->x * scale);
|
||||||
box->y = std::round(box->y * scale);
|
box->y = std::round(box->y * scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string removeBeginEndSpacesTabs(std::string str) {
|
||||||
|
while (str[0] == ' ' || str[0] == '\t') {
|
||||||
|
str = str.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t') {
|
||||||
|
str = str.substr(0, str.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
}
|
}
|
|
@ -5,4 +5,5 @@
|
||||||
void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString);
|
void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString);
|
||||||
void wlr_signal_emit_safe(struct wl_signal *signal, void *data);
|
void wlr_signal_emit_safe(struct wl_signal *signal, void *data);
|
||||||
std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
|
std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
|
||||||
void scaleBox(wlr_box*, float);
|
void scaleBox(wlr_box*, float);
|
||||||
|
std::string removeBeginEndSpacesTabs(std::string);
|
Loading…
Add table
Reference in a new issue