diff options
author | taiyu <[email protected]> | 2015-09-08 10:27:09 -0700 |
---|---|---|
committer | taiyu <[email protected]> | 2015-09-08 10:27:09 -0700 |
commit | aa22dc31132fb7ef504bc90a03a14cc122fcc4e1 (patch) | |
tree | 24bf819a50ae2ff908ca68fd8f32868a7de39ecb /sway/config.c | |
parent | fd6d06ff610687ce65b64e2be4e8262f64391a90 (diff) |
var replacement changes
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/sway/config.c b/sway/config.c index 6d445ec6..7d3104c7 100644 --- a/sway/config.c +++ b/sway/config.c @@ -231,34 +231,9 @@ bool read_config(FILE *file, bool is_active) { while (!feof(file)) { line = read_line(file); line = strip_comments(line); - list_t *args = split_string(line, whitespace); - if (!args->length) { - goto cleanup; - } - //TODO make this better, it only handles modes right now, and very - //simply at that - if (strncmp(args->items[0], "}", 1) == 0) { - config->current_mode = default_mode; - goto cleanup; - } - struct cmd_handler *handler; - if ((handler = find_handler(args->items[0]))) { - if (handler->config_type == CMD_KEYBIND) { - sway_log(L_ERROR, "Invalid command during config ``%s''", line); - } else if (handler->config_type == CMD_COMPOSITOR_READY && !is_active) { - sway_log(L_DEBUG, "Deferring command ``%s''", line); - char *cmd = strdup(line); - list_add(config->cmd_queue, cmd); - } else if (!handle_command(line)) { - sway_log(L_DEBUG, "Config load failed for line ``%s''", line); - success = false; - config->failed = true; - } - } else { - sway_log(L_ERROR, "Invalid command ``%s''", line); + if (!config_command(line)) { + success = false; } - cleanup: - free_flat_list(args); free(line); } |