From c1088d77ac24f6655d430005711d2515f3f169ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 17 Nov 2019 09:39:43 +0100 Subject: [PATCH] term: rename: print_needs_wrap -> lcf (Last Column Flag) --- csi.c | 18 +++++++++--------- terminal.c | 8 ++++---- terminal.h | 2 +- vt.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/csi.c b/csi.c index 3a01b36e..30f07923 100644 --- a/csi.c +++ b/csi.c @@ -413,13 +413,13 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &term->cursor, &(struct coord){term->cols - 1, term->rows - 1}); - term->print_needs_wrap = false; + term->lcf = false; break; case 1: /* From start of screen to cursor */ term_erase(term, &(struct coord){0, 0}, &term->cursor); - term->print_needs_wrap = false; + term->lcf = false; break; case 2: @@ -428,7 +428,7 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &(struct coord){0, 0}, &(struct coord){term->cols - 1, term->rows - 1}); - term->print_needs_wrap = false; + term->lcf = false; break; case 3: { @@ -471,14 +471,14 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &term->cursor, &(struct coord){term->cols - 1, term->cursor.row}); - term->print_needs_wrap = false; + term->lcf = false; break; case 1: /* From start of line to cursor */ term_erase( term, &(struct coord){0, term->cursor.row}, &term->cursor); - term->print_needs_wrap = false; + term->lcf = false; break; case 2: @@ -487,7 +487,7 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &(struct coord){0, term->cursor.row}, &(struct coord){term->cols - 1, term->cursor.row}); - term->print_needs_wrap = false; + term->lcf = false; break; default: @@ -558,7 +558,7 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &(struct coord){term->cursor.col + remaining, term->cursor.row}, &(struct coord){term->cols - 1, term->cursor.row}); - term->print_needs_wrap = false; + term->lcf = false; break; } @@ -585,7 +585,7 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &term->cursor, &(struct coord){term->cursor.col + count - 1, term->cursor.row}); - term->print_needs_wrap = false; + term->lcf = false; break; } @@ -606,7 +606,7 @@ csi_dispatch(struct terminal *term, uint8_t final) term, &term->cursor, &(struct coord){term->cursor.col + count - 1, term->cursor.row}); - term->print_needs_wrap = false; + term->lcf = false; break; } diff --git a/terminal.c b/terminal.c index 98551d3f..707b45f1 100644 --- a/terminal.c +++ b/terminal.c @@ -855,7 +855,7 @@ term_reset(struct terminal *term, bool hard) term->colors.bg = term->colors.default_bg; for (size_t i = 0; i < 256; i++) term->colors.table[i] = term->colors.default_table[i]; - term->print_needs_wrap = false; + term->lcf = false; term->cursor = (struct coord){0, 0}; term->saved_cursor = (struct coord){0, 0}; term->alt_saved_cursor = (struct coord){0, 0}; @@ -1024,7 +1024,7 @@ term_cursor_to(struct terminal *term, int row, int col) assert(row < term->rows); assert(col < term->cols); - term->print_needs_wrap = false; + term->lcf = false; term->cursor.col = col; term->cursor.row = row; @@ -1045,7 +1045,7 @@ term_cursor_left(struct terminal *term, int count) int move_amount = min(term->cursor.col, count); term->cursor.col -= move_amount; assert(term->cursor.col >= 0); - term->print_needs_wrap = false; + term->lcf = false; } void @@ -1054,7 +1054,7 @@ term_cursor_right(struct terminal *term, int count) int move_amount = min(term->cols - term->cursor.col - 1, count); term->cursor.col += move_amount; assert(term->cursor.col < term->cols); - term->print_needs_wrap = false; + term->lcf = false; } void diff --git a/terminal.h b/terminal.h index 11cfd495..4e1f0f85 100644 --- a/terminal.h +++ b/terminal.h @@ -201,7 +201,7 @@ struct terminal { int cell_width; /* pixels per cell, x-wise */ int cell_height; /* pixels per cell, y-wise */ - bool print_needs_wrap; + bool lcf; struct scroll_region scroll_region; struct { diff --git a/vt.c b/vt.c index 79e9871e..7b1e9948 100644 --- a/vt.c +++ b/vt.c @@ -713,7 +713,7 @@ esc_dispatch(struct terminal *term, uint8_t final) static inline void pre_print(struct terminal *term) { - if (unlikely(term->print_needs_wrap) && term->auto_margin) { + if (unlikely(term->lcf) && term->auto_margin) { if (term->cursor.row == term->scroll_region.end - 1) { term_scroll(term, 1); term_cursor_to(term, term->cursor.row, 0); @@ -728,7 +728,7 @@ post_print(struct terminal *term) if (term->cursor.col < term->cols - 1) term_cursor_right(term, 1); else - term->print_needs_wrap = true; + term->lcf = true; } static inline void