aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2017-08-22 22:08:11 +0200
committerBoris Faure <billiob@gmail.com>2017-08-22 22:08:11 +0200
commit0478a36799d3b4a2050f67486e1649045d9f46c8 (patch)
tree89abe9a24062aa4d22b09a7776ef9845ae684225
parenttermptyesc: correctly handle going to start of line when there is a left margin (diff)
downloadterminology-0478a36799d3b4a2050f67486e1649045d9f46c8.tar.gz
termptyops.c: fix scrolling wrt bottom margin
Thanks to @ncim for the report
-rw-r--r--src/bin/termptyops.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index f4fb345..ba7bbf1 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -134,8 +134,17 @@ termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
{
int e = ty->h;
- if (ty->termstate.bottom_margin != 0) e = ty->termstate.bottom_margin;
- if (ty->cursor_state.cy >= e)
+ if (ty->termstate.bottom_margin != 0)
+ {
+ e = ty->termstate.bottom_margin;
+ if (ty->cursor_state.cy == e)
+ {
+ termpty_text_scroll(ty, clear);
+ ty->cursor_state.cy = e - 1;
+ TERMPTY_RESTRICT_FIELD(ty->cursor_state.cy, 0, ty->h);
+ }
+ }
+ else if (ty->cursor_state.cy >= ty->h)
{
termpty_text_scroll(ty, clear);
ty->cursor_state.cy = e - 1;