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

obsidian--match-files finds all files with given basename & more #73

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

LA-Toth
Copy link
Contributor

@LA-Toth LA-Toth commented Oct 2, 2023

When issue #64 was opened, obsidian--match-files was lazy, only the suffix was checked, so it found for 'aa.md' both 'aa.md' and 'baa.md'. Its solution broke the relative file name usage (e.g. [[aa.md]] was "found" in the inbox).

To cover both use case the match needs to be either exact (relative to the vault root), or partial, where the searched file name prefixed with '/' is searched with s-ends-with-p.

Fixes issue #72.

When issue licht1stein#64 was opened, obsidian--match-files was lazy,
only the suffix was checked, so it found for 'aa.md' both
'aa.md' and 'baa.md'. Its solution broke the relative file name
usage (e.g. [[aa.md]] was "found" in the inbox).

To cover both use case the match needs to be either exact
(relative to the vault root), or partial, where the searched
file name prefixed with '/' is searched with s-ends-with-p.

Fixes issue licht1stein#72.
@gleitz
Copy link

gleitz commented Nov 3, 2023

I ran into this same issue. I had two files:
Vault/foo/bar/file.md and Vault/scratch.md.
Without this change, if I tried to C-c C-l to insert a wikilink for file.md and then jump to it with C-c C-o obsidian would instead create a brand new file.md at the root of /Vault. With this change, the correct file is located when jumping.
So, just weighing in that I think this should be merged.

@licht1stein licht1stein merged commit cd483a2 into licht1stein:master Nov 5, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants