Fix "Rename page" command (#190)

This commit is contained in:
Chris Zarate
2022-12-13 09:49:31 +01:00
committed by GitHub
parent ff8d658a2a
commit 996b518d93
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -68,6 +68,7 @@ functions:
name: "Page: Rename"
mac: Cmd-Alt-r
key: Ctrl-Alt-r
page: ""
pageComplete:
path: "./page.ts:pageComplete"
+3 -3
View File
@@ -90,12 +90,12 @@ export async function deletePage() {
await space.deletePage(pageName);
}
export async function renamePage(targetName?: string) {
console.log("Got a target name", targetName);
export async function renamePage(cmdDef: any) {
console.log("Got a target name", cmdDef.page);
const oldName = await editor.getCurrentPage();
const cursor = await editor.getCursor();
console.log("Old name is", oldName);
const newName = targetName ||
const newName = cmdDef.page ||
await editor.prompt(`Rename ${oldName} to:`, oldName);
if (!newName) {
return;