diff options
| author | Peter Geissler <peter@haxx.in> | 2026-09-20 19:55:03 +0200 |
|---|---|---|
| committer | Peter Geissler <peter@haxx.in> | 2026-09-20 19:55:03 +0200 |
| commit | 65a694b194bd68f8c6ba4b961e2cc906b8738a6c (patch) | |
| tree | 0c915581b19fd379b4da9e118814c022fefe4e1d /include | |
| parent | sidebar: a talkative pane can no longer cost you a tab (diff) | |
| download | slosh-65a694b194bd68f8c6ba4b961e2cc906b8738a6c.tar.gz slosh-65a694b194bd68f8c6ba4b961e2cc906b8738a6c.tar.xz slosh-65a694b194bd68f8c6ba4b961e2cc906b8738a6c.zip | |
sidebar: a status can have more than one row (tab_bar_status_lines)
Sixteen cells is not enough for a sentence, and a sentence is what a pane
has to say: "add a summary…" is most of a status and none of its meaning.
tab_bar_status_lines 3 word-wraps instead of cutting, and the same column
carries forty-eight cells rather than sixteen.
Wrapped, the rows under a tab stop being a list of panes and become a
paragraph each, so the shape no longer says where one pane's status ends and
the next begins -- both are italic text down one column. Alternate panes are
drawn on alternate bands to say it instead: tab_status_stripe, derived from
the theme like tab_status_fg, so a theme that has never heard of any of this
still gets a band in its own family. Nothing is painted at one line, where
there is no ambiguity to resolve and a band would take a translucent
terminal's background away for nothing.
1 is the default and is the old behaviour exactly, down to cutting at the
column rather than the last word before it: with no next row to move the word
to, breaking early would spend cells on nothing. The reason to prefer a word
boundary only exists once there is somewhere for the word to go.
Rows count against tab_bar_status as before, so wrapping trades panes for
words within the same allowance, and the allowance itself still gives way to
the tabs. A status that will not fit whole is dropped whole and reported with
the ellipsis, rather than shown as a fragment that reads like the whole
thing. Every row of a status is the same `find:` door.
tabstatus's buffer goes to 256 to match pane_status's own slot: at one line
the drawing cut it anyway, but wrapped it is the whole string that has to
survive the trip.
Diffstat (limited to 'include')
| -rw-r--r-- | include/app_internal.h | 1 | ||||
| -rw-r--r-- | include/config.h | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/app_internal.h b/include/app_internal.h index 94a92cf..97f6028 100644 --- a/include/app_internal.h +++ b/include/app_internal.h @@ -394,6 +394,7 @@ extern config_t CFG; #define TAB_COUNT (CFG.tab_count) #define TAB_STATUS_FG (CFG.tab_status_fg) #define TAB_STATUS_BG (CFG.tab_status_bg) +#define TAB_STATUS_STRIPE (CFG.tab_status_stripe) #define STATUS_C (CFG.status) #define STATUS_STATE (CFG.status_state) #define FINDER_FG (CFG.finder_fg) diff --git a/include/config.h b/include/config.h index 0f9d37e..d0aeccd 100644 --- a/include/config.h +++ b/include/config.h @@ -345,6 +345,17 @@ typedef struct { * at all -- the top strip has one row and no room to say any of it. 0 turns * it off. */ uint16_t tab_bar_status; + /* How many rows one pane's status may wrap onto, rather than being cut at + * the sidebar's width. 1 is the old behaviour and the default: a status is + * one row, truncated with an ellipsis. + * + * Above 1 it is word-wrapped, which buys a narrow sidebar a great deal -- + * three rows of sixteen cells is forty-eight, and the difference between + * "add a summary\u2026" and the whole sentence. The cost is that the rows + * under a tab stop being a list of panes and become a paragraph per pane, + * so the stripe below is what keeps one pane's status apart from the next + * one's. Counts against tab_bar_status the same as any other row. */ + uint16_t tab_bar_status_lines; /* Frame the sidebar the way panes are framed, so it reads as part of the * chrome rather than as text floating beside it. In compact mode its lines * are shared with the tab area's outer ring -- the same junction-forming @@ -457,6 +468,14 @@ typedef struct { * none leaves the terminal's own background alone, which is what a * translucent one wants. */ color_t tab_status_fg, tab_status_bg; + /* The other stripe. With wrapped statuses, where one pane's rows end and + * the next one's begin is no longer obvious from the shape -- both are + * just italic text down the same column -- so alternate panes sit on + * alternate bands. Unset and derived from the theme, like tab_status_fg, + * and only ever drawn when a status can actually wrap: a single-row status + * has no ambiguity to resolve, and painting a band behind it would take a + * translucent terminal's own background away for nothing. */ + color_t tab_status_stripe; /* the line along the bottom */ color_t status, status_state; |
