Skip to content

Commit 49c2eae

Browse files
committed
codex: guard canvas file-card cursor fallback (#1124)
1 parent e5a287e commit 49c2eae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/engine/CaptureChoiceEngine.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ export class CaptureChoiceEngine extends QuickAddChoiceEngine {
156156
return;
157157
}
158158

159+
if (
160+
canvasTarget?.kind === "file" &&
161+
action === "insertAfter" &&
162+
this.choice.insertAfter?.createIfNotFound &&
163+
this.choice.insertAfter?.createIfNotFoundLocation === "cursor"
164+
) {
165+
throw new ChoiceAbortError(
166+
"Canvas file cards do not support creating missing insert-after targets at cursor. Use top or bottom.",
167+
);
168+
}
169+
159170
const filePath =
160171
canvasTarget?.kind === "file"
161172
? canvasTarget.targetFile.path

0 commit comments

Comments
 (0)