aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index 3ad1bcf9..bb6533c2 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -1,8 +1,10 @@
#include <stdio.h>
+#include <stdbool.h>
#include <stdlib.h>
#include "readline.h"
#include "stringop.h"
#include "list.h"
+#include "commands.h"
#include "config.h"
struct sway_config *read_config(FILE *file) {
@@ -10,6 +12,8 @@ struct sway_config *read_config(FILE *file) {
config->symbols = create_list();
config->modes = create_list();
+ int temp_braces = 0; // Temporary: skip all config sections with braces
+
while (!feof(file)) {
int _;
char *line = read_line(file);
@@ -18,8 +22,17 @@ struct sway_config *read_config(FILE *file) {
if (!line[0]) {
goto _continue;
}
- printf("Parsing config line %s\n", line);
+ if (temp_braces && line[0] == '}') {
+ temp_braces--;
+ goto _continue;
+ }
+
+ handle_command(config, line);
+
_continue:
+ if (line && line[strlen(line) - 1] == '{') {
+ temp_braces++;
+ }
free(line);
}