mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
terminal: move col/row count, cell width/height and scroll region to terminal
This commit is contained in:
parent
1ecd4a6ae1
commit
3d2ab03f62
5 changed files with 111 additions and 110 deletions
6
vt.c
6
vt.c
|
|
@ -626,7 +626,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
switch (c) {
|
||||
case '\n':
|
||||
/* LF - line feed */
|
||||
if (term->grid.cursor.row == term->grid.scroll_region.end - 1) {
|
||||
if (term->grid.cursor.row == term->scroll_region.end - 1) {
|
||||
term_scroll(term, 1);
|
||||
} else
|
||||
term_cursor_down(term, 1);
|
||||
|
|
@ -671,7 +671,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
|
||||
case ACTION_PRINT: {
|
||||
if (term->grid.print_needs_wrap) {
|
||||
if (term->grid.cursor.row == term->grid.scroll_region.end - 1) {
|
||||
if (term->grid.cursor.row == term->scroll_region.end - 1) {
|
||||
term_scroll(term, 1);
|
||||
term_cursor_to(term, term->grid.cursor.row, 0);
|
||||
} else
|
||||
|
|
@ -694,7 +694,7 @@ action(struct terminal *term, enum action action, uint8_t c)
|
|||
|
||||
cell->attrs = term->vt.attrs;
|
||||
|
||||
if (term->grid.cursor.col < term->grid.cols - 1)
|
||||
if (term->grid.cursor.col < term->cols - 1)
|
||||
term_cursor_right(term, 1);
|
||||
else
|
||||
term->grid.print_needs_wrap = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue