aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-24 16:20:26 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-24 16:20:26 +0000
commit2c6f7adc17832c77b2353338b0c76c8a19f4112b (patch)
treecf9aaded753e8338e398e9aed1ab5bb675a27193
parentrender: add code that calculates current position in scrollback (diff)
config: add 'show-scrollback-position' option to footrc
-rw-r--r--config.c4
-rw-r--r--config.h1
-rw-r--r--doc/foot.5.scd4
-rw-r--r--render.c2
4 files changed, 9 insertions, 2 deletions
diff --git a/config.c b/config.c
index 283a72ea..9666da61 100644
--- a/config.c
+++ b/config.c
@@ -291,6 +291,9 @@ parse_section_main(const char *key, const char *value, struct config *conf,
conf->scrollback_lines = lines;
}
+ else if (strcmp(key, "show-scrollback-position") == 0)
+ conf->show_scrollback_position = str_to_bool(value);
+
else {
LOG_ERR("%s:%u: invalid key: %s", path, lineno, key);
return false;
@@ -918,6 +921,7 @@ config_load(struct config *conf, const char *conf_path)
.startup_mode = STARTUP_WINDOWED,
.fonts = tll_init(),
.scrollback_lines = 1000,
+ .show_scrollback_position = true,
.colors = {
.fg = default_foreground,
diff --git a/config.h b/config.h
index 2b43b806..c21e1160 100644
--- a/config.h
+++ b/config.h
@@ -40,6 +40,7 @@ struct config {
tll(struct config_font) fonts;
int scrollback_lines;
+ bool show_scrollback_position;
struct {
uint32_t fg;
diff --git a/doc/foot.5.scd b/doc/foot.5.scd
index 92ac7c01..fd5a5d42 100644
--- a/doc/foot.5.scd
+++ b/doc/foot.5.scd
@@ -68,6 +68,10 @@ in this order:
*scrollback*
Number of scrollback lines. Default: _1000_.
+*show-scrollback-position*
+ Boolean. Enables a position indicator when the viewport is not at
+ the bottom of the scrollback history. Default: _yes_.
+
*workers*
Number of threads to use for rendering. Set to 0 to disable
multithreading. Default: the number of available logical CPUs
diff --git a/render.c b/render.c
index da6c2610..6611fbb9 100644
--- a/render.c
+++ b/render.c
@@ -1290,10 +1290,8 @@ render_csd(struct terminal *term)
static void
render_scrollback_position(struct terminal *term)
{
-#if 0
if (!term->conf->show_scrollback_position)
return;
-#endif
/* Find absolute row number of the scrollback start */
int scrollback_start = term->grid->offset + term->rows;