-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cannot find existing markdown files outside inbox #72
Comments
I'm running into this issue, too. I just made a comment on the pull request that introduced that code to reference this issue. |
Sorry if I answer just now, I had a difficult week actually… I mean, it was incidental that was working before I fixed #64, it worked just because the I’ll try to help finding a solution, can you please send me an example of the bug you are experiencing? I mean, if you could create a test vault where the problem occurs it will be great. |
I'm not sure if The original code was:
It should become something like:
So either there is an actual match or one or more that ends with the actual file name. My use case: |
I keep not understanding why you think it is correct that However, your solution seems fine to me, go ahead and create a pull request. |
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.
I just wrote that if it is not called from |
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.
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.
I agree that this PR needs to be merged. More info at #73 (comment) |
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.
I think this can be closed as it's fixed. |
While I worked on issue #70, I tried to figure out why it can't find the existing markdown file with or without my changes.
The
obsidian-find-file
tries to match the file fromall-files
coming from the cache, but fails on this line:And that was the strangely working function:
What I expected is to have a generic idea what should be shown for the actually matching file, but strangely it thinks that the file is in the inbox folder. Visiting a wiki link the code iterates on all files, so for instance the
moc.md
in theMY_OBSIDIAN_FOLDER
produces:The reason behind that is the behavior of
file-relative-name
. If the first parameter,f
is a relative path, like in my case, it prefixes with the current directory (based on my reproduction in**scratch**
buffer), so if the current directory is the inbox, the actual filename will be/home/user/MY_OBSIDIAN_FOLDER/000 Inbox/moc.md
instead of/home/user/MY_OBSIDIAN_FOLDER/moc.md
, this is why the result is useless. And obviously if the file is already in the inbox, like, e.g.000 Inbox/my-idea.md
, the result is000 Inbox/000 Inbox/moc.md
.So this function should not be called here.
The text was updated successfully, but these errors were encountered: