From af6a37b1c4509c7766933a7cb45d2ee9a3a23f98 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 11:37:31 +0300 Subject: Return owned text and share cell attribute flags with snapshots Make text queries return allocated strings released with term_text_free, keeping each capture atomic. Align public attributes with the write core, remove snapshot conversion tables, and migrate tests and the Kitty adapter. --- tests/term_test.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/term_test.c') diff --git a/tests/term_test.c b/tests/term_test.c index 3721720..66dbd96 100644 --- a/tests/term_test.c +++ b/tests/term_test.c @@ -1811,16 +1811,15 @@ static void test_concurrent_feed_and_snapshot(void) (void)c; /* Every reader is safe while another thread feeds. */ - char buf[256]; term_select_start(t, (struct term_vector2i){ .x = 0, .y = 0 }, false, TERM_SELECT_WORD); term_select_extend(t, (struct term_vector2i){ .x = 40, .y = 10 }, false); (void)term_has_selection(t); - (void)term_selection_text(t, buf, sizeof(buf)); - (void)term_link_at(t, (struct term_vector2i){ .x = 1, .y = 1 }, buf, sizeof(buf)); - (void)term_cwd(t, buf, sizeof(buf)); - (void)term_pointer_shape(t, buf, sizeof(buf)); + term_text_free(term_selection_text(t)); + term_text_free(term_link_at(t, (struct term_vector2i){ .x = 1, .y = 1 })); + term_text_free(term_cwd(t)); + term_text_free(term_pointer_shape(t)); (void)term_history_rows(t); - (void)term_history_text(t, 5, buf, sizeof(buf)); + term_text_free(term_history_text(t, 5)); struct term_scrollback sb = term_scrollback(t); assert(sb.offset >= 0 && sb.total >= 0); } -- cgit v1.2.3