Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WikiPageRename doesn't refresh tags #175

Closed
anjiro opened this issue Jul 20, 2021 · 4 comments
Closed

WikiPageRename doesn't refresh tags #175

anjiro opened this issue Jul 20, 2021 · 4 comments

Comments

@anjiro
Copy link
Contributor

anjiro commented Jul 20, 2021

After using WikiPageRename I would expect wiki#tags#get_all() to include the updated page name, but it still has the old name. I think the right fix would be to change the filename everywhere it occurs in s:tags.collection in autoload/wiki/tags.vim, but that requires extra global functions so I'm hesitant to take a stab at a pull request.

@lervag
Copy link
Owner

lervag commented Sep 5, 2021

A simple fix would be to refresh all tags. I.e. simply add call wiki#tags#reload() at the end of wiki#page#rename. Do you see any reason why that would not resolve your issue (just wondering if I'm missing something, here)?

@lervag
Copy link
Owner

lervag commented Sep 5, 2021

Perhaps the minor inconvenience would be that parsing tags may take some time. I am considering to put the tags into a cache to avoid parsing all files everytime. It should be quite simple and would speed up the tag feature quite a lot in big projects, I believe.

@anjiro
Copy link
Contributor Author

anjiro commented Sep 5, 2021

I think that the wiki#tags#reload() approach would probably work fine, but indeed might take a bit of extra time. For my scale of wiki right now I think it would not be particularly problematic.

lervag added a commit that referenced this issue Sep 6, 2021
This should speed up tag parsing by a lot, except for the first time.

refer: #175
lervag added a commit that referenced this issue Sep 6, 2021
@lervag
Copy link
Owner

lervag commented Sep 6, 2021

Ok, I've implemented this now, including the caching. Can you test?

@lervag lervag closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants