fix: arrow keys in prompts now move cursor, also implements delete key #11
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user