mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-22 01:40:17 -05:00
config: add free-form text variant to 'scrollback-indicator-format'
And make the empty string the new default.
This commit is contained in:
parent
eadb5a4a88
commit
2882fbb537
5 changed files with 31 additions and 12 deletions
12
render.c
12
render.c
|
|
@ -1358,20 +1358,26 @@ render_scrollback_position(struct terminal *term)
|
|||
? 1.0
|
||||
: (double)rebased_view / term->grid->num_rows;
|
||||
|
||||
wchar_t text[64];
|
||||
wchar_t _text[64];
|
||||
const wchar_t *text = _text;
|
||||
int cell_count;
|
||||
|
||||
/* *What* to render */
|
||||
switch (term->conf->scrollback.indicator.format) {
|
||||
case SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE:
|
||||
swprintf(text, sizeof(text) / sizeof(text[0]), L"%u%%", (int)(100 * percent));
|
||||
swprintf(_text, sizeof(_text) / sizeof(_text[0]), L"%u%%", (int)(100 * percent));
|
||||
cell_count = 3;
|
||||
break;
|
||||
|
||||
case SCROLLBACK_INDICATOR_FORMAT_LINENO:
|
||||
swprintf(text, sizeof(text) / sizeof(text[0]), L"%d", rebased_view + 1);
|
||||
swprintf(_text, sizeof(_text) / sizeof(_text[0]), L"%d", rebased_view + 1);
|
||||
cell_count = 1 + (int)log10(term->grid->num_rows);
|
||||
break;
|
||||
|
||||
case SCROLLBACK_INDICATOR_FORMAT_TEXT:
|
||||
text = term->conf->scrollback.indicator.text;
|
||||
cell_count = wcslen(text);
|
||||
break;
|
||||
}
|
||||
|
||||
const int scale = term->scale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue