1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-04-10 04:36:46 +00:00

Rename: Leave transclusion on redirection hyphae

This commit is contained in:
Timur Ismagilov 2022-12-09 18:43:38 +03:00
parent bdb5bfc6ec
commit 7140c79b63

View File

@ -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) {