aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2018-08-21 09:27:19 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2018-08-21 09:27:19 +0100
commitbfc9fb4b3bd626b3183728f8d781ebbb5ecd9872 (patch)
tree80d4bdd0cc7acb884aa53921b545d4ad4d3c5854 /tty.c
parent314ee137a91fcbed7459716f600c19d220e05845 (diff)
downloadrtmux-bfc9fb4b3bd626b3183728f8d781ebbb5ecd9872.tar.gz
rtmux-bfc9fb4b3bd626b3183728f8d781ebbb5ecd9872.tar.bz2
rtmux-bfc9fb4b3bd626b3183728f8d781ebbb5ecd9872.zip
Add flags to refresh-client (-U -D -L -R and -c) to pan a window that
is larger than the client manually. Bound to S-Up, S-Down, S-Left, S-Right and Delete manually. Also add aliases for keys DC = Delete, IC = Insert, and make refresh-client -C accept XxY as well as X,Y to match default-size.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 9a756d1c..a6cfadf9 100644
--- a/tty.c
+++ b/tty.c
@@ -738,12 +738,24 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy)
*oy = 0;
*sx = w->sx;
*sy = w->sy;
+
+ c->pan_window = NULL;
return (0);
}
*sx = tty->sx;
*sy = tty->sy - lines;
+ if (c->pan_window == w) {
+ if (c->pan_ox + *sx > w->sx)
+ c->pan_ox = w->sx - *sx;
+ *ox = c->pan_ox;
+ if (c->pan_oy + *sy > w->sy)
+ c->pan_oy = w->sy - *sy;
+ *oy = c->pan_oy;
+ return (1);
+ }
+
if (~wp->screen->mode & MODE_CURSOR) {
*ox = 0;
*oy = 0;
@@ -766,6 +778,7 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy)
*oy = cy - *sy / 2;
}
+ c->pan_window = NULL;
return (1);
}