summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2015-10-23 16:02:21 +0000
committernicm <nicm>2015-10-23 16:02:21 +0000
commit14da99940806dd63c2180ad238886fcb6735db04 (patch)
tree0fb85a4357a92b6c2eed2a17967575d0de9aecd7 /format.c
parent63a3fd3c0fa41fec6cbc15dbd2bf08ceb3ccb208 (diff)
Format for scroll position, from Jorge Morante.
Diffstat (limited to 'format.c')
-rw-r--r--format.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/format.c b/format.c
index 2fae8da0..1d80fbf7 100644
--- a/format.c
+++ b/format.c
@@ -1005,7 +1005,7 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
{
struct grid *gd = wp->base.grid;
u_int idx;
- int status;
+ int status, scroll_position;
if (ft->w == NULL)
ft->w = wp->window;
@@ -1052,6 +1052,10 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "scroll_region_upper", "%u", wp->base.rupper);
format_add(ft, "scroll_region_lower", "%u", wp->base.rlower);
+ scroll_position = window_copy_scroll_position(wp);
+ if (scroll_position != -1)
+ format_add(ft, "scroll_position", "%d", scroll_position);
+
format_add(ft, "alternate_on", "%d", wp->saved_grid ? 1 : 0);
format_add(ft, "alternate_saved_x", "%u", wp->saved_cx);
format_add(ft, "alternate_saved_y", "%u", wp->saved_cy);