From 1e69599900a753e2d7275d7ba714202b7d9c843e Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 14:46:44 +0300 Subject: Eliminate pen style and history stream parameter smuggling - Introduce struct text_pen bundling (fg, bg, sl) across screen and core - Reduce text_append from 9 to 7 parameters - Reduce text_commit from 8 to 6 parameters - Reduce hist_runs_add_pen from 5 to 3 parameters - Reduce sc_text_ascii and sc_ascii_fast from 6 to 4 parameters - Remove unused fg, bg parameters from mark_row_blank - Introduce struct hist_stream_state in src/hist.c, reducing stream_lines from 9 to 5 params and lf_rows from 10 to 6 params - Introduce struct hist_view_pos in src/hist_view.h, reducing term_hist_view_row_pos from 9 to 7 params --- src/fastcsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fastcsi.c') diff --git a/src/fastcsi.c b/src/fastcsi.c index 74d4800..416e3dc 100644 --- a/src/fastcsi.c +++ b/src/fastcsi.c @@ -144,7 +144,7 @@ int term_try_fast_csi(struct term *t, const char *buf, size_t rem) flags_pad = term_flags_pad(t); flags_ok = true; } - if (TERM_EXPECT(!sc_put1_fast(t, ch, fg, bg, flags_pad), 0)) { + if (TERM_EXPECT(!sc_put1_fast(t, ch, (struct text_pen){ fg, bg, flags_pad }), 0)) { t->cur_fg = fg; t->cur_bg = bg; sc_print_ascii(t, &ch, 1); @@ -343,7 +343,7 @@ tail: flags_pad = term_flags_pad(t); flags_ok = true; } - if (!sc_ascii_fast(t, p, run, fg, bg, flags_pad)) + if (!sc_ascii_fast(t, p, run, (struct text_pen){ fg, bg, flags_pad })) sc_print_ascii(t, p, run); p += run; } -- cgit v1.2.3