From 7140c79b63ec4e561843375804063eb8edcf3de7 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Fri, 9 Dec 2022 18:43:38 +0300 Subject: [PATCH] Rename: Leave transclusion on redirection hyphae --- shroom/rename.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shroom/rename.go b/shroom/rename.go index 24fb5bd..4f7205c 100644 --- a/shroom/rename.go +++ b/shroom/rename.go @@ -93,9 +93,13 @@ func Rename(oldHypha hyphae.ExistingHypha, newName string, recursive bool, leave return nil } +const redirectionTemplate = `=> %[1]s | ✏️ %[2]s +<= %[1]s | full +` + func leaveRedirection(oldName, newName string, hop *history.Op) error { var ( - text = fmt.Sprintf("=> %s | ✏️ %s\n", newName, util.BeautifulName(newName)) + text = fmt.Sprintf(redirectionTemplate, newName, util.BeautifulName(newName)) emptyHypha = hyphae.ByName(oldName) ) switch emptyHypha := emptyHypha.(type) {