diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-13 15:38:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-13 15:38:38 +0000 |
commit | 75d1f0c8cf483aa77cd2bb722c41fe8dcf19f32e (patch) | |
tree | 337bbae1d31deb6e914e7d12f241b285f82e9bf7 /usr.bin/tmux/grid-view.c | |
parent | 2aff57fa0b0da877f1ccfe59494580fa2e2c959d (diff) |
Move lines into the history when scrolling even if the scroll region is not
the entire screen.
Allows ircII users to see history, prompted by naddy.
Diffstat (limited to 'usr.bin/tmux/grid-view.c')
-rw-r--r-- | usr.bin/tmux/grid-view.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/usr.bin/tmux/grid-view.c b/usr.bin/tmux/grid-view.c index 70aee107187..266ea69dee9 100644 --- a/usr.bin/tmux/grid-view.c +++ b/usr.bin/tmux/grid-view.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid-view.c,v 1.6 2009/07/13 10:43:52 nicm Exp $ */ +/* $OpenBSD: grid-view.c,v 1.7 2009/10/13 15:38:37 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -92,15 +92,20 @@ grid_view_scroll_region_up(struct grid *gd, u_int rupper, u_int rlower) { GRID_DEBUG(gd, "rupper=%u, rlower=%u", rupper, rlower); - if (gd->flags & GRID_HISTORY && rupper == 0 && rlower == gd->sy - 1) { - grid_scroll_line(gd); - return; + if (gd->flags & GRID_HISTORY) { + grid_collect_history(gd); + if (rupper == 0 && rlower == gd->sy - 1) + grid_scroll_history(gd); + else { + rupper = grid_view_y(gd, rupper); + rlower = grid_view_y(gd, rlower); + grid_scroll_history_region(gd, rupper, rlower); + } + } else { + rupper = grid_view_y(gd, rupper); + rlower = grid_view_y(gd, rlower); + grid_move_lines(gd, rupper, rupper + 1, rlower - rupper); } - - rupper = grid_view_y(gd, rupper); - rlower = grid_view_y(gd, rlower); - - grid_move_lines(gd, rupper, rupper + 1, rlower - rupper); } /* Scroll region down. */ |