It turns out that the target extension here in `ext` has a dot prepended.
Under manual testing, this seems to fix the issue where a wiki with
`markdown_link_ext` set and using `.md` (for example) in links will wind up
taking people to pages with a repeated extension, like `foo.md.md`.
I feel like the repeated use of:
vimwiki#vars#get_wikilocal('ext', link_infos.index)
here should probably be replaced with a named variable like `target_ext`,
but I wanted to touch the minimum lines of code possible for this fix.
If a link contains `.`, then this:
fnamemodify(link_text, ':e')
will return the last .-separated part of the name as extension, and nothing
else will get appended. Instead, we check if the extension is empty _or_
doesn't match the extension for the target wiki, in which case we append
the correct one.
This seems like it works, and might not break anything else, given the
branch of the function that it's in.
Co-authored-by: Brennen Bearnes <code@p1k3.com>
I find this is one of the more common reasons I wind up with way too many
copies of the same file open.
This adds 2 new magic numbers to vimwiki#diary#make_note()'s second
parameter: 4 for `tab drop` and 5 for `drop`. It also checks to make sure
:drop exists in the current build.
Replaces :e in `vimwiki#base#follow_link()` with :drop, making this the
default behavior for pressing <CR> on a link. Checks for the existence
of :drop first, since this isn't available in some builds.
Adds a new :VimwikiTabDropLink and makes this a default for the keybindings
formerly occupied by :VimwikiTabnewLink; leaving :VimwikiTabnewLink
available for backwards compatibility and anyone who still wants the old
behavior.
Doesn't touch the split window reuse functionality, or the
:VimwikiGoBackLink behavior, although I can see an argument for adding
:drop to the latter.
I've wanted this for a while and happened to notice @davidlmontgomery's
patch from 2016 in #238. Code has moved around a little since, but I
think this is correct.
Before updating a listing, check if the update differs from the existing state.
Only then update the buffer, otherwise return early.
Initial reasoning: If `let g:vimwiki_auto_toc = 1` is set, saving a buffer would always update
the `contents`-section, even if there were no updates in this section. This lead to undesired
undo-behavior.
NOTE: this fix was only tested for the toc-listing.
When using vim's native mechanism for `packages`, wildcards (*) are used
in the `runtimepath` since package folders can have arbitrary names.
They were not expanded, thus a path to e.g. `default.tpl` could not be
resolved when calling Vimwiki2HTML.
Resolvesvimwiki/vimwiki#1193
There is an extra space when calling the `basename` command, which causes the following error:
```
Vimwiki: 'basename: extra operand ‘md’
Try ''basename --help'' for more information.
```
README.md: point to libera.chat channel
Per discussion in #1131.
README-cn.md still needs updated. This removes mention of the Telegram
group, but I'm guessing that can be re-bridged to the correct IRC / Matrix channel.
Co-authored-by: KaiserBarbarossa <kaiser.barbarossa@yandex.com>
Co-authored-by: Brennen Bearnes <code@p1k3.com>
Previously TOC links contained a closing </a>-tag, but lacked the
accompanying start tag, leading to invalid HTML. This fixes that, along
with placing class="justcenter" on the correct tag once again.