File: tag_update_existing_heading.vader

package info (click to toggle)
vim-vimwiki 2024.01.24-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,692 kB
  • sloc: sh: 313; makefile: 2
file content (63 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Test how vimwiki#tags#generate_tags behaves when updating existing tag link sections

Before (Setup test wiki files):
  call writefile([":usedtag:", ":othertag:"], expand("~/testmarkdown/Test-Tag-tagged.md"))
  edit ~/testmarkdown/Test-Tag-links.md

After (Cleanup files):
  %delete
  call system("rm $HOME/testmarkdown/.vimwiki_tags")
  call system("rm $HOME/testmarkdown/Test-Tag-tagged.md")
  call system("rm $HOME/testmarkdown/Test-Tag-links.md")


Do (Create preexisting tag links with unused tag):
  I
  # Generated Tags\<CR>
  \<CR>
  ## unusedtag\<CR>
  \<CR>
  ## usedtag\<CR>
  \<ESC>
  :VimwikiRebuildTags!\<CR>
  :call vimwiki#tags#generate_tags(0)\<CR>

Expect (Keeps unused tag header):
  # Generated Tags

  ## unusedtag


  ## usedtag

  - [Test-Tag-tagged](Test-Tag-tagged)

Do (Create preexisting tag subheadings out of alphabetical order):
  I
  # Generated Tags\<CR>
  \<CR>
  ## z\<CR>
  \<CR>
  ## usedtag\<CR>
  \<CR>
  ## a\<CR>
  \<CR>
  # Other Stuff
  \<ESC>
  :VimwikiRebuildTags!\<CR>
  :call vimwiki#tags#generate_tags(0)\<CR>

Expect (Existing tag subheading order is preserved):
  # Generated Tags

  ## z


  ## usedtag

  - [Test-Tag-tagged](Test-Tag-tagged)

  ## a


  # Other Stuff