mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Format for scroll position, from Jorge Morante.
This commit is contained in:
parent
63a3fd3c0f
commit
14da999408
6
format.c
6
format.c
@ -1005,7 +1005,7 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
|
|||||||
{
|
{
|
||||||
struct grid *gd = wp->base.grid;
|
struct grid *gd = wp->base.grid;
|
||||||
u_int idx;
|
u_int idx;
|
||||||
int status;
|
int status, scroll_position;
|
||||||
|
|
||||||
if (ft->w == NULL)
|
if (ft->w == NULL)
|
||||||
ft->w = wp->window;
|
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_upper", "%u", wp->base.rupper);
|
||||||
format_add(ft, "scroll_region_lower", "%u", wp->base.rlower);
|
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_on", "%d", wp->saved_grid ? 1 : 0);
|
||||||
format_add(ft, "alternate_saved_x", "%u", wp->saved_cx);
|
format_add(ft, "alternate_saved_x", "%u", wp->saved_cx);
|
||||||
format_add(ft, "alternate_saved_y", "%u", wp->saved_cy);
|
format_add(ft, "alternate_saved_y", "%u", wp->saved_cy);
|
||||||
|
1
tmux.1
1
tmux.1
@ -3406,6 +3406,7 @@ The following variables are available, where appropriate:
|
|||||||
.It Li "pid" Ta "" Ta "Server PID"
|
.It Li "pid" Ta "" Ta "Server PID"
|
||||||
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
|
.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_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_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_attached" Ta "" Ta "Number of clients session is attached to"
|
||||||
.It Li "session_activity" Ta "" Ta "Integer time of session last activity"
|
.It Li "session_activity" Ta "" Ta "Integer time of session last activity"
|
||||||
|
1
tmux.h
1
tmux.h
@ -2082,6 +2082,7 @@ void printflike(2, 3) window_copy_add(struct window_pane *, const char *, ...);
|
|||||||
void window_copy_vadd(struct window_pane *, const char *, va_list);
|
void window_copy_vadd(struct window_pane *, const char *, va_list);
|
||||||
void window_copy_pageup(struct window_pane *);
|
void window_copy_pageup(struct window_pane *);
|
||||||
void window_copy_start_drag(struct client *, struct mouse_event *);
|
void window_copy_start_drag(struct client *, struct mouse_event *);
|
||||||
|
int window_copy_scroll_position(struct window_pane *);
|
||||||
|
|
||||||
/* window-choose.c */
|
/* window-choose.c */
|
||||||
extern const struct window_mode window_choose_mode;
|
extern const struct window_mode window_choose_mode;
|
||||||
|
@ -2219,6 +2219,16 @@ window_copy_scroll_down(struct window_pane *wp, u_int ny)
|
|||||||
screen_write_stop(&ctx);
|
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
|
void
|
||||||
window_copy_rectangle_toggle(struct window_pane *wp)
|
window_copy_rectangle_toggle(struct window_pane *wp)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user