aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:02:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-15 18:02:21 +0000
commit26a8d4b8a1efc345d61a5f7174e25caae65198d9 (patch)
tree44723e6cb67724b11ac3ff6e292942a6ed6fb5aa /config.c
parentMerge branch 'text-reflow-fixes' (diff)
parentdoc: foot.5: document new 'pad' configuration option (diff)
Merge branch 'configurable-padding'
Diffstat (limited to 'config.c')
-rw-r--r--config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/config.c b/config.c
index 80e0e868..1dd6652f 100644
--- a/config.c
+++ b/config.c
@@ -172,6 +172,19 @@ parse_section_main(const char *key, const char *value, struct config *conf,
conf->height = height;
}
+ else if (strcmp(key, "pad") == 0) {
+ unsigned x, y;
+ if (sscanf(value, "%ux%u", &x, &y) != 2) {
+ LOG_ERR(
+ "%s: %d: expected PAD_XxPAD_Y, where both are positive integers: %s",
+ path, lineno, value);
+ return false;
+ }
+
+ conf->pad_x = x;
+ conf->pad_y = y;
+ }
+
else if (strcmp(key, "font") == 0) {
char *copy = strdup(value);
for (const char *font = strtok(copy, ","); font != NULL; font = strtok(NULL, ",")) {
@@ -472,6 +485,8 @@ config_load(struct config *conf, const char *conf_path)
.shell = get_shell(),
.width = -1,
.height = -1,
+ .pad_x = 2,
+ .pad_y = 2,
.fonts = tll_init(),
.scrollback_lines = 1000,