From cf072ebdf289abf523a0735974401cd812787b6b Mon Sep 17 00:00:00 2001 From: Rane Brown Date: Mon, 30 Dec 2019 10:24:52 -0700 Subject: [PATCH] Update how tags are written to file. Ensures older vims are still supported. --- autoload/vimwiki/tags.vim | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index c9a1471..995ef18 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -279,16 +279,18 @@ function! s:write_tags_metadata(metadata) abort endfor call sort(tags, 's:tags_entry_cmp') let tag_comments = [ - \ "!_TAG_FILE_FORMAT\t2", - \ "!_TAG_FILE_SORTED\t1", - \ "!_TAG_OUTPUT_MODE\tvimwiki-tags", - \ "!_TAG_PROGRAM_AUTHOR\tVimwiki", - \ "!_TAG_PROGRAM_NAME\tVimwiki Tags", - \ "!_TAG_PROGRAM_URL\thttps://github.com/vimwiki/vimwiki", \ "!_TAG_PROGRAM_VERSION\t2.4.1", + \ "!_TAG_PROGRAM_URL\thttps://github.com/vimwiki/vimwiki", + \ "!_TAG_PROGRAM_NAME\tVimwiki Tags", + \ "!_TAG_PROGRAM_AUTHOR\tVimwiki", + \ "!_TAG_OUTPUT_MODE\tvimwiki-tags", + \ "!_TAG_FILE_SORTED\t1", + \ "!_TAG_FILE_FORMAT\t2", \ ] - call writefile(tag_comments, metadata_path) - call writefile(tags, metadata_path, 'a') + for c in tag_comments + call insert(tags, c) + endfor + call writefile(tags, metadata_path) endfunction