-
Notifications
You must be signed in to change notification settings - Fork 620
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
Fix resolution of leading-slash page links and add link tests #1108
Conversation
Nice job. You added two file in testwiki => please update the /testplugin/test/link_generation.vader to expect what it gets (2 new files). |
Ah, thanks. First time I've written anything for vader, so I'm fumbling around a bit. I'll try to finish the pull request tonight, with some tests for Markdown syntax links. |
@tinmarino any idea why I think other test failures here are already present on dev. |
@brennen I don't exactly know but the vim/vimwiki session is shared across files so the modified configuration can affect next tests. I prefer all tests to pass with this PR rather than keeping old broken tests |
Hopefully this solves #1084, "Page links with leading slash lead to a file in working directory, not a page at the root of the wiki", introduced in 850aace. It also adds a set of tests for different kinds of wiki links: - api_base_resolve_link.vader - link_syntax_markdown.vader - link_syntax_vimwiki.vader Includes some fixes for locally-failing tests, removes a test from test/map.vader and comments out test/config_vars.vader entirely for the moment.
I wound up commenting out 2: the config variable tests, and the one for autocompletion in a list in I also disabled the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good,
Most of the changes are in tests, comments and better variable names.
The tests are passing so this time I push the green button.
PS: I prefer no to squash your commits as trying to minimise the commit number is a bad pattern.
Edit: plus it is only 2 commit (I thought 17 ...)
Edit: I had to squash it anyway.
if is_wiki_link && link_text[0] ==# '/' | ||
if link_text !=# '/' | ||
if link_text !=# '//' && link_text[0:1] ==# '//' | ||
let link_text = resolve(expand(link_text)) | ||
let link_text = link_text[2:] | ||
let is_absolute = 1 | ||
let is_absolute_wiki_link = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes !
Good: explicit better than implicit especially when talky about absoluteness
complete3 | ||
* complete2 | ||
|
||
# brennen commenting this out 2021-03-29 - test seems to flap, test failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I did not mention it but this file gave many troubles.
Ranebrown did isolate it in a custom docker session. I tryed to play with the order to go faster but it may be guilty from bugs 20 tests later.
if v:version < 704 | return [] | endif | ||
" | ||
" Warning: must only be called if has("patch-7.4-2008") | ||
" Or rather: If execute() exists - it's not available for all 7.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it more clear (and mantainable)
@@ -3894,6 +3898,7 @@ Contributors and their Github usernames in roughly chronological order: | |||
- Yifan Hu (@yhu266) | |||
- Levi Rizki Saputra (@levirs565) | |||
- Fergus Collins (@C-Fergus) | |||
- Brennen Bearnes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol ! I put mine on the first commits.
Hopefully this solves vimwiki#1084, "Page links with leading slash lead to a file in working directory, not a page at the root of the wiki", introduced in 850aace. It also adds a set of tests for different kinds of wiki links: - api_base_resolve_link.vader - link_syntax_markdown.vader - link_syntax_vimwiki.vader Includes some fixes for locally-failing tests, removes a test from test/map.vader and comments out test/config_vars.vader entirely for the moment. Code by : Brennen Bearnes <code@p1k3.com>
Hopefully this solves #1084, "Page links with leading slash lead to a file in working directory, not a page at the root of the wiki", introduced in 850aace.
It also adds a set of tests for different kinds of wiki links.
TODO:
//
linksvimwiki#base#resolve_link()
directly (if plausible)api_
Steps for submitting a pull request:
dev
branch!doc/vimwiki.txt
if applicable,including the Changelog and Contributors sections.