Preserve marks between restarts.
This commit is contained in:
parent
96ed68de16
commit
3cc22dcbe4
|
@ -200,6 +200,11 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||||
ystr("urgent");
|
ystr("urgent");
|
||||||
y(bool, con->urgent);
|
y(bool, con->urgent);
|
||||||
|
|
||||||
|
if (con->mark != NULL) {
|
||||||
|
ystr("mark");
|
||||||
|
ystr(con->mark);
|
||||||
|
}
|
||||||
|
|
||||||
ystr("focused");
|
ystr("focused");
|
||||||
y(bool, (con == focused));
|
y(bool, (con == focused));
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,10 @@ static int json_string(void *ctx, const unsigned char *val, unsigned int len) {
|
||||||
json_node->layout = L_OUTPUT;
|
json_node->layout = L_OUTPUT;
|
||||||
else LOG("Unhandled \"layout\": %s\n", buf);
|
else LOG("Unhandled \"layout\": %s\n", buf);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
} else if (strcasecmp(last_key, "mark") == 0) {
|
||||||
|
char *buf = NULL;
|
||||||
|
asprintf(&buf, "%.*s", (int)len, val);
|
||||||
|
json_node->mark = buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue