billiob pushed a commit to branch master.
commit ea60fdf9a4160872d57a57bfb1dbed519299b2dc
Author: Boris Faure <[email protected]>
Date: Fri Apr 5 22:55:54 2013 +0200
reflow: fix setting cursor position on vertical shrink
---
src/bin/termpty.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index a78aafb..3c81dca 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1093,7 +1093,7 @@ shrink_screen:
cells = &TERMPTY_SCREEN(ty, 0, y);
len = termpty_line_length(cells, ty->w);
termpty_text_save_top(ty, cells, len);
- ty->state.cy++;
+ ty->state.cy--;
}
else
y++;
@@ -1103,6 +1103,8 @@ shrink_screen:
}
if (ty->state.cy >= ty->h)
ty->state.cy = ty->h - 1;
+ else if (ty->state.cy < 0)
+ ty->state.cy = 0;
free(screen_lengths);
}
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter