-
Notifications
You must be signed in to change notification settings - Fork 189
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
ObsidianOpen
opens file as if vault directory is the MacOS root directory if vault dir is behind symbolic link
#107
Comments
ObsidianOpen
opens file as if vault directory is the MacOS root directory if vault dir is behind symbolic link
Hey @shakesbeare, If you get a chance to debug before I do, I suspect the issue might be in this function: obsidian.nvim/lua/obsidian/init.lua Lines 128 to 141 in 5f48a8b
|
I did some digging and I think you're right that this is the origin of the bug. The link is not being expanded into it's absolute version there, which is causing issues further down the pipeline here: obsidian.nvim/lua/obsidian/command.lua Line 107 in 4bc10b8
because you naturally can't make a relative version of the path from the vault when the path doesn't look like a subdirectory of the vault directory. At my best guess, it seems like it's an issue on Plenary's end. A brief glance at their open issues reveals that following links might not be implemented for them across the board. Do you want to try and hack together a solution or just document and wait for plenary to fix it? |
@shakesbeare if you have an idea for a workaround I'd be happy to accept a PR |
🐛 Describe the bug
If obsidian vault is configured to use a directory behind a symlink, using
:ObsidianOpen
while in a note which already exists opens a blank file from the vault directory as if it the vault directory were the root of the entire file tree.Example:
File:
/path/to/vault/Notes/my_note.md
Obsidian Opens:
/path/to/vault/path/to/vault/again/Notes/my_note.md
For completeness, here is a real example using my own paths:
File:
/Users/username/Library/CloudStorage/Dropbox/Documents/0-obsidian-notes/MUS-490 Landing Page.md
Obsidian Opens:
/Users/username/Library/CloudStorage/Dropbox/Documents/0-obsidian-notes/Users/my-name/Library/CloudStorage/Dropbox/Documents/0-obsidian-notes/MUS-490 Landing Page.md
Note that this error occurs regardless of if the note is in a subdirectory of the vault or note.
Working config:
Bad config:
For what it's worth, it seems to work completely properly as long as I removed the link dir from my config and instead used the absolute dir, but this is absolutely not expected behavior so I figured it's worth documenting at the very least. I can't say for sure whether this happens on other operating systems.
Seems I also have some error in some kind of python-related thing going on that I just discovered as I was writing this up. Doesn't seem related, but I also don't know what to do about it. Happy to mess with it if you think it's relevant. I haven't noticed any other odd behavior besides in any of my nvim experience besides #106. I did go through and test to see if that issue is still present with the alternate config and it indeed is.
Versions
The text was updated successfully, but these errors were encountered: