mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-24 09:05:48 -04:00
config: add 'scrollback-indicator-format' option
The value of this option must be either 'percent', or 'line', and determines _how_ we render the scrollback indicator.
This commit is contained in:
parent
e945063620
commit
5b868fd0c9
3 changed files with 20 additions and 0 deletions
14
config.c
14
config.c
|
|
@ -294,6 +294,19 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
||||||
else if (strcmp(key, "scrollback-indicator") == 0)
|
else if (strcmp(key, "scrollback-indicator") == 0)
|
||||||
conf->scrollback_indicator = str_to_bool(value);
|
conf->scrollback_indicator = str_to_bool(value);
|
||||||
|
|
||||||
|
else if (strcmp(key, "scrollback-indicator-format") == 0) {
|
||||||
|
if (strcmp(value, "percent") == 0)
|
||||||
|
conf->scrollback_indicator_format = SCROLLBACK_INDICATOR_PERCENT;
|
||||||
|
else if (strcmp(value, "line") == 0)
|
||||||
|
conf->scrollback_indicator_format = SCROLLBACK_INDICATOR_LINENO;
|
||||||
|
else {
|
||||||
|
LOG_ERR("%s:%d: 'scrollback-indicator-format must be one "
|
||||||
|
"of 'percent' or 'line', not %s",
|
||||||
|
path, lineno, value);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
LOG_ERR("%s:%u: invalid key: %s", path, lineno, key);
|
LOG_ERR("%s:%u: invalid key: %s", path, lineno, key);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -922,6 +935,7 @@ config_load(struct config *conf, const char *conf_path)
|
||||||
.fonts = tll_init(),
|
.fonts = tll_init(),
|
||||||
.scrollback_lines = 1000,
|
.scrollback_lines = 1000,
|
||||||
.scrollback_indicator = true,
|
.scrollback_indicator = true,
|
||||||
|
.scrollback_indicator_format = SCROLLBACK_INDICATOR_PERCENT,
|
||||||
|
|
||||||
.colors = {
|
.colors = {
|
||||||
.fg = default_foreground,
|
.fg = default_foreground,
|
||||||
|
|
|
||||||
1
config.h
1
config.h
|
|
@ -41,6 +41,7 @@ struct config {
|
||||||
|
|
||||||
int scrollback_lines;
|
int scrollback_lines;
|
||||||
bool scrollback_indicator;
|
bool scrollback_indicator;
|
||||||
|
enum {SCROLLBACK_INDICATOR_PERCENT, SCROLLBACK_INDICATOR_LINENO} scrollback_indicator_format;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint32_t fg;
|
uint32_t fg;
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,11 @@ in this order:
|
||||||
Boolean. Enables a position indicator when the viewport is not at
|
Boolean. Enables a position indicator when the viewport is not at
|
||||||
the bottom of the scrollback history. Default: _yes_.
|
the bottom of the scrollback history. Default: _yes_.
|
||||||
|
|
||||||
|
*scrollback-indicator-format*
|
||||||
|
Which format to use when displaying the scrollback position
|
||||||
|
indicator. Either _percent_ or _line_. This option is ignored if
|
||||||
|
*scrollback-indicator=no*. Default: _percent_.
|
||||||
|
|
||||||
*workers*
|
*workers*
|
||||||
Number of threads to use for rendering. Set to 0 to disable
|
Number of threads to use for rendering. Set to 0 to disable
|
||||||
multithreading. Default: the number of available logical CPUs
|
multithreading. Default: the number of available logical CPUs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue