Closed rfhlmn closed 6 months ago
This should solve https://github.com/michal-h21/vim-zettel/pull/142
Thanks, for this, this looks great! I will be mostly offline for the next 7 days, so I will test it and hopefully merge sometime in the next week, probably.
I just realized this will probably break on Windows, as the path separator is "wrong" for Windows. I'll look into what I have to do to make that work as well. I can't test it, though, as I don't have a Windows machine.
Sorry for the late reply, I've got some cold on my vacations.
I think forward slashes are not a problem on Windows, they should work in recent Windows versions. It would be also a problem if user shared the wiki over multiple machines with different operating systems.
No worries, I hope you're all better now. :)
Oh, I didn't know that. Fair enough, that makes the code a bit easier as well.
Thank you!
Yeah, I am OK now, thanks. I've set the s:path_sep
variable to forward slash, but kept your original code in comments, so if we find in the future that backslashes are needed, we can use it.
Glad to hear it!
Alright, cool, makes a lot of sense to me. :grin:
When editing file a/b/c.md and trying to link to a/f/d.md, the current behaviour is to link from the root of the wiki, which doesn't work. I.e. the link would be 'a/f/d.md', when we need '../f/d.md'.
So here we make the link relative to the file we're editing.
I didn't find a place to write some unit tests, but it worked for the obvious three cases:
Do let me know if I should polish something up.
Happy holidays