summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hood <cgull@glup.org>2017-05-05 23:28:34 -0400
committerJohn Hood <cgull@glup.org>2017-05-06 11:15:43 -0400
commit72199ffc0bf5233a8aecd29f720d0c9255ea3b60 (patch)
treecde23bebc1246dfa7e95662c95411008f9739f2d
parentdf4dbe0d6c9c3ac7a6a102f315090c9b7aa75ad6 (diff)
Do not move cursor for SCROLL UP and SCROLL DOWN
This fixes #881, corrupted display of man pages with tables in tmux 2.4.
-rw-r--r--src/terminal/terminalframebuffer.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc
index 6905183..a4b90ea 100644
--- a/src/terminal/terminalframebuffer.cc
+++ b/src/terminal/terminalframebuffer.cc
@@ -119,11 +119,8 @@ void Framebuffer::scroll( int N )
{
if ( N >= 0 ) {
delete_line( ds.get_scrolling_region_top_row(), N );
- ds.move_row( -N, true );
} else {
- N = -N;
- insert_line( ds.get_scrolling_region_top_row(), N );
- ds.move_row( N, true );
+ insert_line( ds.get_scrolling_region_top_row(), -N );
}
}
@@ -187,9 +184,13 @@ void Framebuffer::move_rows_autoscroll( int rows )
}
if ( ds.get_cursor_row() + rows > ds.get_scrolling_region_bottom_row() ) {
- scroll( ds.get_cursor_row() + rows - ds.get_scrolling_region_bottom_row() );
+ int N = ds.get_cursor_row() + rows - ds.get_scrolling_region_bottom_row();
+ scroll( N );
+ ds.move_row( -N, true );
} else if ( ds.get_cursor_row() + rows < ds.get_scrolling_region_top_row() ) {
- scroll( ds.get_cursor_row() + rows - ds.get_scrolling_region_top_row() );
+ int N = ds.get_cursor_row() + rows - ds.get_scrolling_region_top_row();
+ scroll( N );
+ ds.move_row( -N, true );
}
ds.move_row( rows, true );