aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-14 16:46:42 +0200
committeruser <user@clank>2026-08-14 16:46:42 +0200
commit18e96314d5a4ea62b16ae0c9cb1558985d270800 (patch)
tree76be4a915fef5e16beb1dc36eb8fe67ab7b5824d /src/config.c
parentsl0ppty: the status line counts this tab's panes (diff)
downloadslosh-18e96314d5a4ea62b16ae0c9cb1558985d270800.tar.gz
slosh-18e96314d5a4ea62b16ae0c9cb1558985d270800.tar.xz
slosh-18e96314d5a4ea62b16ae0c9cb1558985d270800.zip
sl0ppty: the status line says which pane, not just how many
A bare count answered "how big is this tab" and left "where am I in it" to be worked out by counting frames — which is exactly the question you have once a tab has collapsed into a list and only one pane is open, and exactly when counting frames stops working. It reads `pane 2/5` now. It also stops looking like the session count in the opposite corner. Two numbers in two corners, both rendered "N panes" and disagreeing, was a puzzle the reader had to solve once and then remember. Both bars also take a `status_pad` for how far they are held off the left and right edges. They were using `gap * gap_aspect`, which is the space around the *panes*: the two match at the defaults and there was never a reason they had to be the same number. The count is kept as a fallback for when nothing is focused, which should not happen but says something true if it does.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index e0a40fe..142776c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -179,6 +179,9 @@ void config_defaults(config_t *c) {
c->double_click_ms = 400;
c->status_bar = true;
c->status_line = true;
+ /* Matches gap * gap_aspect at the defaults, so the strip lines up with the
+ * panes' outer edge until you say otherwise. */
+ c->status_pad = 2;
c->focus_follows_mouse = true;
c->default_fg = rgb(0xff, 0xff, 0xff);
@@ -297,6 +300,8 @@ bool config_load(config_t *c, const char *path, char *err, size_t errcap) {
c->status_bar = kdl_arg_bool(kdl_child(root, "status_bar"), 0, c->status_bar);
c->status_line =
kdl_arg_bool(kdl_child(root, "status_line"), 0, c->status_line);
+ c->status_pad =
+ (uint16_t)kdl_arg_int(kdl_child(root, "status_pad"), 0, c->status_pad);
c->focus_follows_mouse = kdl_arg_bool(kdl_child(root, "focus_follows_mouse"), 0,
c->focus_follows_mouse);