Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
* changed hasDescriptions to hasDescription
  • Loading branch information
Moerliy committed Jun 9, 2024
1 parent e756f51 commit 05a1e22
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 37 deletions.
30 changes: 15 additions & 15 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1954,16 +1954,16 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
// bind[fl]=SUPER,G,exec,dmenu_run <args>

// flags
bool locked = false;
bool release = false;
bool repeat = false;
bool mouse = false;
bool nonConsuming = false;
bool transparent = false;
bool ignoreMods = false;
bool multiKey = false;
bool has_description = false;
const auto BINDARGS = command.substr(4);
bool locked = false;
bool release = false;
bool repeat = false;
bool mouse = false;
bool nonConsuming = false;
bool transparent = false;
bool ignoreMods = false;
bool multiKey = false;
bool hasDescription = false;
const auto BINDARGS = command.substr(4);

for (auto& arg : BINDARGS) {
if (arg == 'l') {
Expand All @@ -1983,7 +1983,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
} else if (arg == 's') {
multiKey = true;
} else if (arg == 'd') {
has_description = true;
hasDescription = true;
} else {
return "bind: invalid flag";
}
Expand All @@ -1995,10 +1995,10 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
if (mouse && (repeat || release || locked))
return "flag m is exclusive";

const int numbArgs = has_description ? 5 : 4;
const int numbArgs = hasDescription ? 5 : 4;
const auto ARGS = CVarList(value, numbArgs);

const int DESCR_OFFSET = has_description ? 1 : 0;
const int DESCR_OFFSET = hasDescription ? 1 : 0;
if ((ARGS.size() < 3 && !mouse) || (ARGS.size() < 3 && mouse))
return "bind: too few args";
else if ((ARGS.size() > (size_t)4 + DESCR_OFFSET && !mouse) || (ARGS.size() > (size_t)3 + DESCR_OFFSET && mouse))
Expand All @@ -2020,7 +2020,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command

const auto KEY = multiKey ? "" : ARGS[1];

const auto DESCRIPTION = has_description ? ARGS[2] : "";
const auto DESCRIPTION = hasDescription ? ARGS[2] : "";

auto HANDLER = ARGS[2 + DESCR_OFFSET];

Expand Down Expand Up @@ -2053,7 +2053,7 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
}

g_pKeybindManager->addKeybind(SKeybind{parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER, COMMAND, locked, m_szCurrentSubmap, DESCRIPTION,
release, repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, has_description});
release, repeat, mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription});
}

return {};
Expand Down
5 changes: 2 additions & 3 deletions src/debug/HyprCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,8 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) {
ret += "e";
if (kb.nonConsuming)
ret += "n";
if (kb.hasDescriptions) {
if (kb.hasDescription)
ret += "d";
}

ret += std::format("\n\tmodmask: {}\n\tsubmap: {}\n\tkey: {}\n\tkeycode: {}\n\tcatchall: {}\n\tdescription: {}\n\tdispatcher: {}\n\targ: {}\n\n", kb.modmask, kb.submap,
kb.key, kb.keycode, kb.catchAll, kb.description, kb.handler, kb.arg);
Expand Down Expand Up @@ -821,7 +820,7 @@ std::string bindsRequest(eHyprCtlOutputFormat format, std::string request) {
"arg": "{}"
}},)#",
kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.nonConsuming ? "true" : "false",
kb.hasDescriptions ? "true" : "false", kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode, kb.catchAll ? "true" : "false",
kb.hasDescription ? "true" : "false", kb.modmask, escapeJSONStrings(kb.submap), escapeJSONStrings(kb.key), kb.keycode, kb.catchAll ? "true" : "false",
escapeJSONStrings(kb.description), escapeJSONStrings(kb.handler), escapeJSONStrings(kb.arg));
}
trimTrailingComma(ret);
Expand Down
38 changes: 19 additions & 19 deletions src/managers/KeybindManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ class CPluginSystem;
class IKeyboard;

struct SKeybind {
std::string key = "";
std::set<xkb_keysym_t> sMkKeys = {};
uint32_t keycode = 0;
bool catchAll = false;
uint32_t modmask = 0;
std::set<xkb_keysym_t> sMkMods = {};
std::string handler = "";
std::string arg = "";
bool locked = false;
std::string submap = "";
std::string description = "";
bool release = false;
bool repeat = false;
bool mouse = false;
bool nonConsuming = false;
bool transparent = false;
bool ignoreMods = false;
bool multiKey = false;
bool hasDescriptions = false;
std::string key = "";
std::set<xkb_keysym_t> sMkKeys = {};
uint32_t keycode = 0;
bool catchAll = false;
uint32_t modmask = 0;
std::set<xkb_keysym_t> sMkMods = {};
std::string handler = "";
std::string arg = "";
bool locked = false;
std::string submap = "";
std::string description = "";
bool release = false;
bool repeat = false;
bool mouse = false;
bool nonConsuming = false;
bool transparent = false;
bool ignoreMods = false;
bool multiKey = false;
bool hasDescription = false;

// DO NOT INITIALIZE
bool shadowed = false;
Expand Down

0 comments on commit 05a1e22

Please sign in to comment.