phibr0 / obsidian-open-with

MIT License
35 stars 3 forks source link

Use the correct function to normalize an absolute path #19

Closed unbleaklessness closed 1 year ago

unbleaklessness commented 1 year ago

This plugin does not work correctly on Linux because an 'absolute' path that you get from the getAbsolutePathOfFile function does not contain leading / (so the path is not absolute). For example, if I want to open a note in NeoVim, the resulting command will look something like this: nvim home/user/Documents/Obsidian/Note.md. But should instead be: nvim /home/user/Documents/Obsidian/Note.md.

I used this forum post to resolve this issue: normalizePath() removes a leading /.

phibr0 commented 1 year ago

Thank you