Also add a vader test case and update the changelog as well as the list of contributors. Co-authored-by: Tinmarino <tinmarino@gmail.com>
This commit is contained in:
@@ -345,6 +345,7 @@ function! vimwiki#tags#generate_tags(create, ...) abort
|
|||||||
|
|
||||||
let lines = []
|
let lines = []
|
||||||
let bullet = repeat(' ', vimwiki#lst#get_list_margin()).vimwiki#lst#default_symbol().' '
|
let bullet = repeat(' ', vimwiki#lst#get_list_margin()).vimwiki#lst#default_symbol().' '
|
||||||
|
let current_dir = vimwiki#base#current_subdir()
|
||||||
for tagname in sort(keys(tags_entries))
|
for tagname in sort(keys(tags_entries))
|
||||||
if need_all_tags || index(self.specific_tags, tagname) != -1
|
if need_all_tags || index(self.specific_tags, tagname) != -1
|
||||||
if len(lines) > 0
|
if len(lines) > 0
|
||||||
@@ -361,6 +362,7 @@ function! vimwiki#tags#generate_tags(create, ...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
for taglink in sort(tags_entries[tagname])
|
for taglink in sort(tags_entries[tagname])
|
||||||
|
let taglink = vimwiki#path#relpath(current_dir, taglink)
|
||||||
if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown'
|
if vimwiki#vars#get_wikilocal('syntax') ==# 'markdown'
|
||||||
let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink3Template')
|
let link_tpl = vimwiki#vars#get_syntaxlocal('Weblink3Template')
|
||||||
let link_infos = vimwiki#base#resolve_link(taglink)
|
let link_infos = vimwiki#base#resolve_link(taglink)
|
||||||
|
|||||||
@@ -3968,6 +3968,7 @@ Contributors and their Github usernames in roughly chronological order:
|
|||||||
- Stefan Schuhbäck (@stefanSchuhbaeck)
|
- Stefan Schuhbäck (@stefanSchuhbaeck)
|
||||||
- Vinny Furia (@vinnyfuria)
|
- Vinny Furia (@vinnyfuria)
|
||||||
- paperbenni (@paperbenni)
|
- paperbenni (@paperbenni)
|
||||||
|
- Philipp Oberdiek (@RonMcKay)
|
||||||
- Lily Foster (@lilyinstarlight)
|
- Lily Foster (@lilyinstarlight)
|
||||||
- Jean-Luc Bastarache (@jlbas)
|
- Jean-Luc Bastarache (@jlbas)
|
||||||
- Youssof Taha (@ysftaha)
|
- Youssof Taha (@ysftaha)
|
||||||
@@ -4077,6 +4078,7 @@ Fixed:~
|
|||||||
* PR #1030: Allow overwriting insert mode mappings
|
* PR #1030: Allow overwriting insert mode mappings
|
||||||
* PR #1057: Fix renaming, updating link, and exporting HTML subdir wrong
|
* PR #1057: Fix renaming, updating link, and exporting HTML subdir wrong
|
||||||
Fix resolve subdir return wrong path in Windows
|
Fix resolve subdir return wrong path in Windows
|
||||||
|
* Issue #794: Fix: Generated tag links are build wrong
|
||||||
* Issue #763: Links opening in qutebrowser multiple times on Linux
|
* Issue #763: Links opening in qutebrowser multiple times on Linux
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -205,3 +205,77 @@ Execute (Clean Test-Tag and .vimwiki_tags -1 ):
|
|||||||
call DeleteHiddenBuffers()
|
call DeleteHiddenBuffers()
|
||||||
|
|
||||||
# vim: sw=2:foldlevel=30:foldmethod=marker:
|
# vim: sw=2:foldlevel=30:foldmethod=marker:
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
Execute (Check first tags file):
|
||||||
|
call system("mkdir -p $HOME/testmarkdown/subdir1/subdir11")
|
||||||
|
edit $HOME/testmarkdown/Test-Tag-1.md
|
||||||
|
AssertEqual $HOME . '/testmarkdown/Test-Tag-1.md', expand('%')
|
||||||
|
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
|
||||||
|
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
|
||||||
|
|
||||||
|
Do (Build first tags file):
|
||||||
|
:edit $HOME/testmarkdown/Test-Tag-1.md\<Cr>
|
||||||
|
ggI
|
||||||
|
# A Header\<Cr>
|
||||||
|
:header-tag-1:\<Cr>
|
||||||
|
\<Cr>
|
||||||
|
# Another Header\<Cr>
|
||||||
|
:header-tag-2:\<Cr>
|
||||||
|
\<Cr>
|
||||||
|
:standalone-tag-1:
|
||||||
|
\<Esc>
|
||||||
|
:write\<Cr>
|
||||||
|
:VimwikiRebuildTags!\<CR>
|
||||||
|
|
||||||
|
Execute (Check second tags file):
|
||||||
|
edit $HOME/testmarkdown/subdir1/Test-Tag-2.md
|
||||||
|
AssertEqual $HOME . '/testmarkdown/subdir1/Test-Tag-2.md', expand('%')
|
||||||
|
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
|
||||||
|
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
|
||||||
|
|
||||||
|
Do (Build second tags file):
|
||||||
|
:edit $HOME/testmarkdown/subdir1/Test-Tag-2.md\<Cr>
|
||||||
|
ggI
|
||||||
|
# A Header\<Cr>
|
||||||
|
:header-tag-1:\<Cr>
|
||||||
|
\<Cr>
|
||||||
|
# Another Header\<Cr>
|
||||||
|
:header-tag-2:\<Cr>
|
||||||
|
\<Cr>
|
||||||
|
:standalone-tag-1:
|
||||||
|
\<Esc>
|
||||||
|
:write\<Cr>
|
||||||
|
:VimwikiRebuildTags!\<CR>
|
||||||
|
|
||||||
|
Execute (Build tag links in third file):
|
||||||
|
edit $HOME/testmarkdown/subdir1/subdir11/Test-Tag-Links.md
|
||||||
|
AssertEqual $HOME . '/testmarkdown/subdir1/subdir11/Test-Tag-Links.md', expand('%')
|
||||||
|
AssertEqual 'markdown', vimwiki#vars#get_wikilocal('syntax')
|
||||||
|
AssertEqual 1, vimwiki#vars#get_bufferlocal('wiki_nr')
|
||||||
|
VimwikiGenerateTagLinks
|
||||||
|
write
|
||||||
|
|
||||||
|
Expect (Tag links relative to current file):
|
||||||
|
|
||||||
|
|
||||||
|
# Generated Tags
|
||||||
|
|
||||||
|
## header-tag-1
|
||||||
|
|
||||||
|
- [a-header](../../Test-Tag-1#a-header)
|
||||||
|
- [a-header](../Test-Tag-2#a-header)
|
||||||
|
|
||||||
|
## header-tag-2
|
||||||
|
|
||||||
|
- [another-header](../../Test-Tag-1#another-header)
|
||||||
|
- [another-header](../Test-Tag-2#another-header)
|
||||||
|
|
||||||
|
## standalone-tag-1
|
||||||
|
|
||||||
|
- [standalone-tag-1](../../Test-Tag-1#standalone-tag-1)
|
||||||
|
- [standalone-tag-1](../Test-Tag-2#standalone-tag-1)
|
||||||
|
|
||||||
|
Execute (Clean relative tag setup):
|
||||||
|
call system("rm -rf $HOME/testmarkdown/subdir1")
|
||||||
|
call system("rm $HOME/testmarkdown/Test-Tag-1.md")
|
||||||
|
|||||||
Reference in New Issue
Block a user