mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-16 05:34:00 -04:00
wip: initial scrolling support (no scrollback though)
This commit is contained in:
parent
71dde121e6
commit
efc8cc4914
3 changed files with 39 additions and 2 deletions
14
vt.c
14
vt.c
|
|
@ -158,7 +158,11 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
LOG_DBG("execute: 0x%02x", c);
|
||||
switch (c) {
|
||||
case '\n':
|
||||
grid_cursor_down(&term->grid, 1);
|
||||
LOG_DBG("NEWLINE: %d %d", term->grid.cursor.row, term->grid.rows);
|
||||
if (term->grid.cursor.row == term->grid.rows - 1) {
|
||||
grid_scroll(&term->grid, 1);
|
||||
} else
|
||||
grid_cursor_down(&term->grid, 1);
|
||||
break;
|
||||
|
||||
case '\r':
|
||||
|
|
@ -188,8 +192,14 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
break;
|
||||
|
||||
case ACTION_PRINT: {
|
||||
if (term->grid.print_needs_wrap)
|
||||
if (term->grid.print_needs_wrap) {
|
||||
if (term->grid.cursor.row == term->grid.rows - 1) {
|
||||
assert(false);
|
||||
grid_scroll(&term->grid, 1);
|
||||
}
|
||||
|
||||
grid_cursor_to(&term->grid, term->grid.cursor.row + 1, 0);
|
||||
}
|
||||
|
||||
struct cell *cell = &term->grid.cells[term->grid.linear_cursor];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue