commit - bef915e1bacbb9d875ac9f5019838eb51be56d5f
commit + 4dd664cea4f1c5745dac573900e48c1fee5ab151
blob - 5e63c85183b2ce46f30bc05c4ef898a8477dd153
blob + 9624f972f1373e83d8466b059f74691d240a326c
--- ui.c
+++ ui.c
struct tab *tab;
tab = current_tab();
- tab->s->curs_y = MAX(0, tab->s->curs_y-1);
+
+ if (--tab->s->curs_y < 0) {
+ tab->s->curs_y = 0;
+ cmd_scroll_up(k);
+ }
+
restore_cursor(tab);
}
struct tab *tab;
tab = current_tab();
- tab->s->curs_y = MIN(LINES-1, tab->s->curs_y+1);
+
+ if (++tab->s->curs_y > body_lines-1) {
+ tab->s->curs_y = body_lines-1;
+ cmd_scroll_down(k);
+ }
+
restore_cursor(tab);
}
struct tab *tab;
tab = current_tab();
- tab->s->curs_x = MIN(COLS-1, tab->s->curs_x+1);
+ tab->s->curs_x = MIN(body_cols-1, tab->s->curs_x+1);
restore_cursor(tab);
}