summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-03 20:55:42 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-03 20:55:42 -0500
commit16ab3629d435d52539b6345d79433e27c367ce83 (patch)
tree44fb3c7a13870dbd748e0f35d5236d6b3a31cb9a /config.c
parent35cb8b8cfbd141d4ba2e3f1435a9550864d9e2e1 (diff)
make install, command line arguments
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/config.c b/config.c
index 8431da3..9cca619 100644
--- a/config.c
+++ b/config.c
@@ -31,21 +31,21 @@ static u32 config_parse_key_combo(ConfigReader *cfg, char const *str) {
u32 modifier = 0;
// read modifier
while (true) {
- if (util_is_prefix(str, "Ctrl+")) {
+ if (str_is_prefix(str, "Ctrl+")) {
if (modifier & KEY_MODIFIER_CTRL) {
config_err(cfg, "Ctrl+ written twice");
return 0;
}
modifier |= KEY_MODIFIER_CTRL;
str += strlen("Ctrl+");
- } else if (util_is_prefix(str, "Shift+")) {
+ } else if (str_is_prefix(str, "Shift+")) {
if (modifier & KEY_MODIFIER_SHIFT) {
config_err(cfg, "Shift+ written twice");
return 0;
}
modifier |= KEY_MODIFIER_SHIFT;
str += strlen("Shift+");
- } else if (util_is_prefix(str, "Alt+")) {
+ } else if (str_is_prefix(str, "Alt+")) {
if (modifier & KEY_MODIFIER_ALT) {
config_err(cfg, "Alt+ written twice");
return 0;
@@ -239,14 +239,9 @@ void config_read(Ted *ted, char const *filename) {
// read the command
Command command = command_from_str(value + 1);
if (command != CMD_UNKNOWN) {
- if (action->command) {
- config_err(cfg, "Key binding for %s set twice (first time was on line " U32_FMT ").",
- key, action->line_number);
- } else {
- action->command = command;
- action->argument = argument;
- action->line_number = cfg->line_number;
- }
+ action->command = command;
+ action->argument = argument;
+ action->line_number = cfg->line_number;
} else {
config_err(cfg, "Unrecognized command %s", value);
}