fix: arrow keys in prompts now move cursor, also implements delete key #11

Merged
emma merged 2 commits from 1.0.2 into main 2025-05-21 10:50:57 -07:00
Showing only changes of commit 89a3df17e6 - Show all commits

View File

@ -153,6 +153,7 @@ class RenameFields implements ITool {
const fields = form.getFields();
const foundUpdates: [string, callback][] = [];
let changesMade = false;
for (const field of fields) {
const name = field.getName();
@ -164,6 +165,7 @@ class RenameFields implements ITool {
`${colorize(name, "red")} -> ${colorize(preview, "green")}`,
() => {
applyRename(field, name, patternRegex, toChange);
changesMade = true;
},
]);
}
@ -178,11 +180,15 @@ class RenameFields implements ITool {
);
}
const path = await cliPrompt(
"Save to path (or hit enter to keep current):",
this.block,
);
await savePdf(pdf, path || pdfPath);
if (changesMade) {
const path = await cliPrompt(
"Save to path (or hit enter to keep current):",
this.block,
);
await savePdf(pdf, path || pdfPath);
} else {
cliLog("No changes made, skipping", this.block);
}
}
}
}