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

[Feature request] Prevent infinite loop #78

Open
RyotaUshio opened this issue Sep 18, 2023 · 0 comments
Open

[Feature request] Prevent infinite loop #78

RyotaUshio opened this issue Sep 18, 2023 · 0 comments

Comments

@RyotaUshio
Copy link

RyotaUshio commented Sep 18, 2023

Hi, thank you for this great plugin. It makes my life easier for sure. Especially, I love how it blurs the boundary between note-taking and note-naming.

I noticed that, under some circumstances, this plugin causes an infinity loop like this:

Screen.Recording.2023-09-19.at.1.23.29.mov

At first, the heading is

# [[hello]]

Then, this plugin renames the note "hello.md" because the square brackets are illegal characters.
At this point, the link in the heading points to this note itself.

Then, I add some text to this heading:

# [[hello]] world

Now this plugin renames the note "hello world", which triggers Obsidian's link updates. As a result, we get

# [[hello world]] world

And this process (theoretically) never ends.

So it would be great if this plugin could take care of this kind of stuff.

One possible (imperfect) solution would be, instead of hooking on the vault.on('modify'), running the sync when the cursor moves from a heading line to a non-heading line.

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

1 participant