aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-09 07:24:26 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-09 07:24:26 +0000
commit8cf7d7f7aba8f4324a66735b941ff3649c1901d1 (patch)
tree3e3c3b4e6307d614c49036a6b8a3e7b897aaf489 /vt.c
parentcell: packing the cell struct seems to help performance (diff)
parentrender: store frame callback pointer in terminal struct (diff)
Merge branch 'no-more-linear'
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/vt.c b/vt.c
index 7bab63d1..7ce2ddcb 100644
--- a/vt.c
+++ b/vt.c
@@ -658,6 +658,7 @@ pre_print(struct terminal *term)
static inline void
post_print(struct terminal *term)
{
+ term->grid->cur_row->dirty = true;
if (term->cursor.col < term->cols - 1)
term_cursor_right(term, 1);
else
@@ -669,11 +670,19 @@ print_insert(struct terminal *term)
{
if (unlikely(term->insert_mode)) {
assert(false && "untested");
- grid_memmove(
- term->grid, term->cursor.linear + 1, term->cursor.linear,
+
+ struct row *row = term->grid->cur_row;
+ memmove(
+ &row[term->cursor.col + 1],
+ &row[term->cursor.col],
term->cols - term->cursor.col - 1);
+
+#if 0
term_damage_update(
term, term->cursor.linear + 1, term->cols - term->cursor.col - 1);
+#else
+ row->dirty = true;
+#endif
}
}
@@ -682,8 +691,13 @@ action_print_utf8(struct terminal *term)
{
pre_print(term);
- struct cell *cell = &term->grid->cur_line[term->cursor.col];
+ struct row *row = term->grid->cur_row;
+ struct cell *cell = &row->cells[term->cursor.col];
+#if 0
term_damage_update(term, term->cursor.linear, 1);
+#else
+ row->dirty = true;
+#endif
print_insert(term);
@@ -701,8 +715,13 @@ action_print(struct terminal *term, uint8_t c)
{
pre_print(term);
- struct cell *cell = &term->grid->cur_line[term->cursor.col];
+ struct row *row = term->grid->cur_row;
+ struct cell *cell = &row->cells[term->cursor.col];
+#if 0
term_damage_update(term, term->cursor.linear, 1);
+#else
+ row->dirty = true;
+#endif
print_insert(term);