aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-29 19:15:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-29 19:15:32 +0000
commita8f4cb55afdd3aaaac95e14fd117425a375aa358 (patch)
tree8cc3dc9dd7c698e9f19eaf31f17ca1d49a6aa3e6 /terminal.c
parentterminal: move fore/background colors from grid to terminal (diff)
terminal: move cursor from grid to terminal
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/terminal.c b/terminal.c
index 348167c6..cce4e29f 100644
--- a/terminal.c
+++ b/terminal.c
@@ -208,41 +208,41 @@ term_cursor_to(struct terminal *term, int row, int col)
assert(new_linear >= 0);
assert(new_linear < term->rows * term->cols);
- term_damage_update(term, term->grid.linear_cursor, 1);
+ term_damage_update(term, term->cursor.linear, 1);
term_damage_update(term, new_linear, 1);
term->grid.print_needs_wrap = false;
- term->grid.linear_cursor = new_linear;
- term->grid.cursor.col = col;
- term->grid.cursor.row = row;
+ term->cursor.linear = new_linear;
+ term->cursor.col = col;
+ term->cursor.row = row;
}
void
term_cursor_left(struct terminal *term, int count)
{
- int move_amount = min(term->grid.cursor.col, count);
- term_cursor_to(term, term->grid.cursor.row, term->grid.cursor.col - move_amount);
+ int move_amount = min(term->cursor.col, count);
+ term_cursor_to(term, term->cursor.row, term->cursor.col - move_amount);
}
void
term_cursor_right(struct terminal *term, int count)
{
- int move_amount = min(term->cols - term->grid.cursor.col - 1, count);
- term_cursor_to(term, term->grid.cursor.row, term->grid.cursor.col + move_amount);
+ int move_amount = min(term->cols - term->cursor.col - 1, count);
+ term_cursor_to(term, term->cursor.row, term->cursor.col + move_amount);
}
void
term_cursor_up(struct terminal *term, int count)
{
- int move_amount = min(term->grid.cursor.row, count);
- term_cursor_to(term, term->grid.cursor.row - move_amount, term->grid.cursor.col);
+ int move_amount = min(term->cursor.row, count);
+ term_cursor_to(term, term->cursor.row - move_amount, term->cursor.col);
}
void
term_cursor_down(struct terminal *term, int count)
{
- int move_amount = min(term->rows - term->grid.cursor.row - 1, count);
- term_cursor_to(term, term->grid.cursor.row + move_amount, term->grid.cursor.col);
+ int move_amount = min(term->rows - term->cursor.row - 1, count);
+ term_cursor_to(term, term->cursor.row + move_amount, term->cursor.col);
}
void