vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit 0f38192b0311b7f3c2266dfb373b59e5f0250d05
parent 41199e6e3b8373c1e42ca50e501d57cbae6b912d
Author: Nicolas Brailovsky <brailovs@nl1lxl-105201.ttg.global>
Date:   Wed, 12 Dec 2018 18:07:30 +0100

Patch for issue #585, fix anchor links for multiple extensions

Diffstat:
Mautoload/vimwiki/base.vim | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim @@ -152,7 +152,16 @@ function! vimwiki#base#resolve_link(link_text, ...) let link_infos.anchor = join(split_lnk[1:], '#') endif if link_text == '' " because the link was of the form '#anchor' - let link_text = fnamemodify(source_file, ':p:t:r') + if source_file =~ vimwiki#vars#get_wikilocal('ext') . '$' + " Source file has expected extension. Remove it, it will be added later on + let ext_len = strlen(vimwiki#vars#get_wikilocal('ext')) + let link_text = fnamemodify(source_file, ':p:t')[:-ext_len-1] + else + " Source file has unexpected (or no) extension. A new file with the proper + " extension appended will be created + " let link_text = fnamemodify(source_file, ':p:t:r') + endif + endif endif