aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2013-04-21 22:54:20 +0200
committerPeter Odding <peter@peterodding.com>2013-04-21 22:54:20 +0200
commit01971973a35ae70dcd19373ad83518e490cd9013 (patch)
tree9cbb122793a695a27dc7186de017343df74af124
parent514947b7c76293a9340844b570243cb785a84b59 (diff)
parent10afe7fc2610ebfa5279a140fcd4aead61033175 (diff)
downloadvim-easytags-01971973a35ae70dcd19373ad83518e490cd9013.tar.gz
Merge pull request #37 (prevent cache corruption by moving before tags write)
-rw-r--r--autoload/xolox/easytags.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index fc3ac92..458e270 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -3,7 +3,7 @@
" Last Change: April 21, 2013
" URL: http://peterodding.com/code/vim/easytags/
-let g:xolox#easytags#version = '3.1.4'
+let g:xolox#easytags#version = '3.1.5'
call xolox#misc#compat#check('easytags', 1)
@@ -318,15 +318,18 @@ function! s:filter_merge_tags(filter_tags, tagsfile, output, context) " {{{3
call filter(entries, join(filters, ' && '))
endif
let num_filtered = num_old_entries - len(entries)
- " Merge old/new tags and write tags file.
+ " Merge the old and new tags.
call extend(entries, a:output)
+ " Since we've already read the tags file we might as well cache the tagged
+ " files. We do so before saving the tags file so that the items in {entries}
+ " are not yet flattened by xolox#easytags#write_tagsfile().
+ let fname = s:canonicalize(a:tagsfile, a:context)
+ call s:cache_tagged_files_in(fname, getftime(fname), entries, a:context)
+ " Now we're ready to save the tags file.
if !xolox#easytags#write_tagsfile(a:tagsfile, headers, entries)
let msg = "Failed to write filtered tags file %s!"
throw printf(msg, fnamemodify(a:tagsfile, ':~'))
endif
- " We've already read the tags file, might as well cache the tagged files :-)
- let fname = s:canonicalize(a:tagsfile, a:context)
- call s:cache_tagged_files_in(fname, getftime(fname), entries, a:context)
return num_filtered
endfunction