Preserve shot text when adding markers
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 09:03:49 +00:00
parent b877b49c78
commit dd52dd4b27
+6 -1
View File
@@ -90,7 +90,12 @@ function configure(node) {
};
const syncPrompt = (clip, value) => {
const text = String(value || "");
const marks = [...text.matchAll(/\[Shot\s+(\d+)\][^\n]*(?:\n|$)/gi)];
// The shot description starts on the same line as the marker in the
// CSGlide-style editor. Only consume the marker prefix through its
// timestamp comma; consuming the whole line would discard text such
// as `[Shot 1] At 00:00.000, the character walks...` when a new shot
// is added and the marker scaffold is rebuilt.
const marks = [...text.matchAll(/\[Shot\s+(\d+)\]\s+At\s+[^,\n]+,\s*/gi)];
if (!marks.length) { if (clip.slots[0]) clip.slots[0].text = text.trim(); return; }
marks.forEach((mark, index) => {
const slotIndex = Number(mark[1]) - 1;