-/* $OpenBSD: format.c,v 1.84 2015/09/14 10:25:52 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.85 2015/10/23 16:02:21 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
{
struct grid *gd = wp->base.grid;
u_int idx;
- int status;
+ int status, scroll_position;
if (ft->w == NULL)
ft->w = wp->window;
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);
-.\" $OpenBSD: tmux.1,v 1.451 2015/10/21 13:14:36 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.452 2015/10/23 16:02:21 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 21 2015 $
+.Dd $Mdocdate: October 23 2015 $
.Dt TMUX 1
.Os
.Sh NAME
.It Li "pid" Ta "" Ta "Server PID"
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
+.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
.It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
.It Li "session_activity" Ta "" Ta "Integer time of session last activity"
-/* $OpenBSD: tmux.h,v 1.563 2015/10/18 20:42:42 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.564 2015/10/23 16:02:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
void window_copy_vadd(struct window_pane *, const char *, va_list);
void window_copy_pageup(struct window_pane *);
void window_copy_start_drag(struct client *, struct mouse_event *);
+int window_copy_scroll_position(struct window_pane *);
/* window-choose.c */
extern const struct window_mode window_choose_mode;
-/* $OpenBSD: window-copy.c,v 1.134 2015/09/14 11:57:22 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.135 2015/10/23 16:02:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
screen_write_stop(&ctx);
}
+int
+window_copy_scroll_position(struct window_pane *wp)
+{
+ struct window_copy_mode_data *data = wp->modedata;
+
+ if (wp->mode != &window_copy_mode)
+ return (-1);
+ return (data->oy);
+}
+
void
window_copy_rectangle_toggle(struct window_pane *wp)
{