diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-06-29 19:15:32 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-06-29 19:15:32 +0000 |
| commit | a8f4cb55afdd3aaaac95e14fd117425a375aa358 (patch) | |
| tree | 8cc3dc9dd7c698e9f19eaf31f17ca1d49a6aa3e6 /vt.c | |
| parent | terminal: move fore/background colors from grid to terminal (diff) | |
terminal: move cursor from grid to terminal
Diffstat (limited to 'vt.c')
| -rw-r--r-- | vt.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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->scroll_region.end - 1) { + if (term->cursor.row == term->scroll_region.end - 1) { term_scroll(term, 1); } else term_cursor_down(term, 1); @@ -634,7 +634,7 @@ action(struct terminal *term, enum action action, uint8_t c) case '\r': /* FF - form feed */ - term_cursor_left(term, term->grid.cursor.col); + term_cursor_left(term, term->cursor.col); break; case '\b': @@ -649,9 +649,9 @@ action(struct terminal *term, enum action action, uint8_t c) case '\x09': { /* HT - horizontal tab */ - int col = term->grid.cursor.col; + int col = term->cursor.col; col = (col + 8) / 8 * 8; - term_cursor_right(term, col - term->grid.cursor.col); + term_cursor_right(term, col - term->cursor.col); break; } @@ -671,15 +671,15 @@ 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->scroll_region.end - 1) { + if (term->cursor.row == term->scroll_region.end - 1) { term_scroll(term, 1); - term_cursor_to(term, term->grid.cursor.row, 0); + term_cursor_to(term, term->cursor.row, 0); } else - term_cursor_to(term, term->grid.cursor.row + 1, 0); + term_cursor_to(term, term->cursor.row + 1, 0); } - struct cell *cell = &term->grid.cells[term->grid.linear_cursor]; - term_damage_update(term, term->grid.linear_cursor, 1); + struct cell *cell = &term->grid.cells[term->cursor.linear]; + term_damage_update(term, term->cursor.linear, 1); if (term->vt.utf8.idx > 0) { //LOG_DBG("print: UTF8: %.*s", (int)term->vt.utf8.idx, term->vt.utf8.data); @@ -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->cols - 1) + if (term->cursor.col < term->cols - 1) term_cursor_right(term, 1); else term->grid.print_needs_wrap = true; |
