Skip to content

WikiPageRename fails to update links in subdirectories #385

@qadzek

Description

@qadzek

Thank you again for this plugin. I use it daily and prefer it over Vimwiki because it doesn't mess with my Markdown settings.

I've noticed a small issue: renaming pages sometimes doesn't work as expected.

This script below creates a minimal wiki so you can hopefully reproduce the problem. Each page contains links to all other pages. I used an init.vim that contains only the code necessary to load this plugin and let g:wiki_root = '~/wiki'.

Script
#!/usr/bin/env bash

mkdir -p wiki/one/two

touch wiki/index.md
touch wiki/one/alfa.md
touch wiki/one/bravo.md
touch wiki/one/two/charlie.md

cat <<EOF >wiki/index.md
# Index

Go to [alfa](one/alfa.md)
Go to [bravo](one/bravo.md)
Go to [charlie](one/two/charlie.md)
EOF

cat <<EOF >wiki/one/alfa.md
# Alfa

Go to [index](../index.md)
Go to [bravo](bravo.md)
Go to [charlie](two/charlie.md)
EOF
cat <<EOF >wiki/one/bravo.md
# Bravo

Go to [index](../index.md)
Go to [alfa](alfa.md)
Go to [charlie](two/charlie.md)
EOF

cat <<EOF >wiki/one/two/charlie.md
# Charlie

Go to [index](../../index.md)
Go to [alfa](../alfa.md)
Go to [bravo](../bravo.md)
EOF

The script generates the following directory structure:

wiki
├── index.md
└── one
    ├── alfa.md
    ├── bravo.md
    └── two
        └── charlie.md

When I execute WikiPageRename in alfa.md, the links in index.md (one level up) and bravo.md (same level) are updated correctly. The plugin displays Updated 3 links in 3 files, but the link in charlie.md (one level down) remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions