From 8066204e59097177323cfd85ae0c270d42c38ee1 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Fri, 1 May 2026 19:38:46 +0000 Subject: [PATCH] fix: trigger clip three times on paste to ensure stopped state Co-authored-by: aider (deepseek/deepseek-coder) --- test_tui.c | 3 ++- tui.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test_tui.c b/test_tui.c index 6b27d40..9a07d65 100644 --- a/test_tui.c +++ b/test_tui.c @@ -871,7 +871,7 @@ void test_paste_clips(void) { assert(row_offset == 2); assert(col_offset == 2); - // Simulate paste: trigger clip twice to go empty -> recording -> stopped + // Simulate paste: trigger clip three times to go empty -> recording -> looping -> stopped int new_row = first_yanked_row + row_offset; int new_col = first_yanked_col + col_offset; int new_clip_idx = new_row * 8 + new_col; @@ -880,6 +880,7 @@ void test_paste_clips(void) { assert(new_col == 3); assert(new_clip_idx == 27); + engine_trigger_clip(engine, new_clip_idx); engine_trigger_clip(engine, new_clip_idx); engine_trigger_clip(engine, new_clip_idx); engine_process_commands(engine); diff --git a/tui.c b/tui.c index 2036558..dd1fa81 100644 --- a/tui.c +++ b/tui.c @@ -165,7 +165,8 @@ static void paste_clips(void) { // Bounds check if (new_row >= 0 && new_row < GRID_ROWS && new_col >= 0 && new_col < GRID_COLS) { int new_clip_idx = grid_to_clip_index(new_row, new_col); - // Trigger twice to go from empty -> recording -> stopped + // Trigger three times to go from empty -> recording -> looping -> stopped + engine_trigger_clip(g_engine, new_clip_idx); engine_trigger_clip(g_engine, new_clip_idx); engine_trigger_clip(g_engine, new_clip_idx); }