summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 14:27:58 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 14:27:58 +0300
commit5ab6b560e8528c27ba934b90f94b1828b7771e27 (patch)
tree409c2a2e864529ccda0ff3e3b75b0280279e2a33 /src/screen.c
parent7633ab2c60b40bd5aa67ef391b2a0d149685742f (diff)
Encapsulate stream queue context and consolidate forwarding wrappers
- Create struct stream_emit_ctx packing stream queue arguments into 1 cache line - Reduce emit_stream_bulk_wrapped from 13 parameters to 3 - Reduce flush_stream_queue from 10 parameters to 1 - Extract stream_queue_finish to eliminate duplicated cleanup in kernel instantiations - Replace EMIT_STREAM_ROW macros with typed inline functions - Move pending_wrap clearing directly into term_screen_erase, insert, delete, and scroll - Remove sc_erase_display, sc_erase_line, sc_insert_chars, and sc_delete_chars wrappers - Consolidate term_row and remove duplicated row_fill_gap helper
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index afd9b4a..d0f573c 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -324,9 +324,9 @@ void term_screen_erase_line(struct term *t, int mode)
void term_screen_delete_chars(struct term *t, int n)
{
+ t->pending_wrap = false;
if (t->cursor_x >= t->cols)
return;
- t->pending_wrap = false;
int x = t->cursor_x;
int cols = t->cols;
if (n > cols - x)
@@ -365,9 +365,9 @@ void term_screen_delete_chars(struct term *t, int n)
void term_screen_insert_chars(struct term *t, int n)
{
+ t->pending_wrap = false;
if (t->cursor_x >= t->cols)
return;
- t->pending_wrap = false;
int x = t->cursor_x;
int cols = t->cols;
if (n > cols - x)
@@ -407,6 +407,7 @@ void term_screen_insert_chars(struct term *t, int n)
void term_screen_erase_all(struct term *t)
{
+ t->pending_wrap = false;
struct screen *s = &t->scr;
bool pristine = using_default_colors(t);
for (int y = 0; y < s->rows; y++) {
@@ -544,6 +545,7 @@ static inline bool srow_has_text(const struct srow *r, int cols)
void term_screen_erase(struct term *t, int mode)
{
+ t->pending_wrap = false;
if (mode == 3) {
term_hist_clear(&t->hist);
term_hist_view_clear(&t->view);
@@ -667,6 +669,7 @@ static void rotate_and_clear_srows(struct term *t, struct srow *base, int height
void term_screen_scroll_region(struct term *t, int top, int bottom, int count,
bool down, bool history)
{
+ t->pending_wrap = false;
if (count <= 0 || top > bottom || top < 0 || bottom >= t->rows)
return;
int height = bottom - top + 1;