fix: paste clips now stop instead of recording

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-01 19:36:27 +00:00
parent 51f5905a22
commit 0056dce9af
2 changed files with 5 additions and 2 deletions

View File

@@ -871,7 +871,7 @@ void test_paste_clips(void) {
assert(row_offset == 2);
assert(col_offset == 2);
// Simulate paste: trigger clip at new position
// Simulate paste: trigger clip twice to go empty -> recording -> 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,9 +880,10 @@ 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_process_commands(engine);
assert(engine->clips[27].state == CLIP_RECORDING);
assert(engine->clips[27].state == CLIP_STOPPED);
destroy_test_engine(engine);
printf("PASSED\n");

2
tui.c
View File

@@ -165,6 +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
engine_trigger_clip(g_engine, new_clip_idx);
engine_trigger_clip(g_engine, new_clip_idx);
}
}