From 513bf031a589d9e2a1a2730adf56f95e5e316a06 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 17:17:43 +0300 Subject: Remove unused private functions and inline trivial helpers --- src/screen.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index 5f92929..0bd95c0 100644 --- a/src/screen.h +++ b/src/screen.h @@ -15,7 +15,6 @@ void term_screen_erase_line(struct term *t, int mode); void term_screen_delete_chars(struct term *t, int count); void term_screen_insert_chars(struct term *t, int count); -const struct cell *term_ring_row(const struct term *t, int row); const struct cell *term_screen_view_row(const struct term *t, int y); uint64_t term_screen_view_row_key(const struct term *t, int y); /* The selected columns [c0, c1] of each view row; c1 < c0 when none. */ @@ -26,11 +25,6 @@ int term_screen_history_rows(const struct term *t); /* Rows of history above the live screen. The view owns the offset. */ int term_view_offset(const struct term *t); -static inline struct screen *term_active_screen(const struct term *t) -{ - return (struct screen *)&t->scr; -} - static inline bool screen_has_history(const struct term *t) { return !t->alternate && t->hist.line_limit > 0; @@ -227,7 +221,7 @@ static inline struct srow *text_append_row(struct term *t) if (t->cursor_y > 0) { const struct srow *prev = term_row(t, t->cursor_y - 1); if (prev->kind == ROW_TEXT && (prev->flags & RF_WRAPPED)) - start = text_row_last_pen(&prev->text); + start = prev->text.runs.pen; } if (row->kind == ROW_TEXT) { struct text_pen p = text_pen_from_attr(&start); @@ -373,8 +367,7 @@ static inline void write_cell_span(struct cell *row, int x, static inline void erase_span(struct term *t, int p, int from, int to) { bool pristine = using_default_colors(t); - struct screen *s = term_active_screen(t); - struct srow *row = &s->slot[p]; + struct srow *row = &t->scr.slot[p]; int len = row->len; if (to > TERM_MAX_COLS) to = TERM_MAX_COLS; if (pristine && to > len) to = len; @@ -417,8 +410,7 @@ static inline void erase_span(struct term *t, int p, int from, int to) static inline int erase_width(const struct term *t, int p) { - const struct screen *s = term_active_screen(t); - return s->slot[p].len > t->cols ? s->slot[p].len : t->cols; + return t->scr.slot[p].len > t->cols ? t->scr.slot[p].len : t->cols; } static inline void erase_row(struct term *t, int p) -- cgit v1.2.3