xolox / vim-easytags

Automated tag file generation and syntax highlighting of tags in Vim
http://peterodding.com/code/vim/easytags/
1.01k stars 109 forks source link

FIX: Prevent cache corruption by moving before tags write. #37

Closed inkarkat closed 11 years ago

inkarkat commented 11 years ago

A side effect of xolox#easytags#write_tagsfile() is that the entries argument is joined together. This then causes problems in s:cache_tagged_files_in(), where the filename element is addressed via entry[1]. When the entries have been flattened, this accesses a single character, and then the cache is corrupted.

To fix this, move the cache update before the writing of the tags file. This avoids the need to make a copy of the entries before flattening them.