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

g:easytags_dynamic_files and g:easytags_by_filetype not working as expected #102

Closed brainpower closed 9 years ago

brainpower commented 9 years ago

My easytags config:

set tags=,./tags;,./.tags;./TAGS;,./.TAGS;
let g:easytags_dynamic_files = 1
let g:easytags_file = '~/.vim/gtags-$USER'
let g:easytags_by_filetype = expand("~/.vim/tags-$USER/")
let g:easytags_resolve_links = 1
let g:easytags_updatetime_warn = 0
let g:easytags_languages = { 'php': { 'args': [ '--php-kinds=ncf', '--languages=+JavaScript' ] } }

Now I've got a project with an existing tags file inside, like this:

$ ls -a ~/someproject
.tags
code.c

when editing the projects code.c the following shows with :verbose UpdateTags

[...]
vim-misc 1.17.1: Successfully updated /home/brainpower/.vim/tags-brainpower/cpp using atomic rename in 0.04 seconds.
easytags.vim 3.9.1: Updated 35 tags in 0.058 seconds (synchronously).
easytags.vim 3.9.1: Highlighted tags in ~/someproject/code.c in 0.011 seconds (using Python).

I expected easytags to update /home/brainpower/someproject/.tags file. The help of g:easytags_by_filetype says after all: "Note that the g:easytags_dynamic_files option takes precedence over this option."

:set tags? shows

tags=\,./tags;,./.tags;./TAGS;,./.TAGS;,~/.vim/gtags-brainpower,~/someproject/.tags,~/.vim/gtags-brainpower

If I comment out the let g:easytags_by_filetype it works as expected: all tags outside the project go into the gtags-xxx file, the projects tags go into the someproject/.tags file. In this case :set tags? shows:

tags=\,./tags;,./.tags;./TAGS;,./.TAGS;,~/.vim/gtags-brainpower,~/.vim/gtags-brainpower

and the output of :verbose UpdateTags is:

vim-misc 1.17.1: Successfully updated /home/brainpower/someproject/.tags using atomic rename in 0.042 seconds.
easytags.vim 3.9.1: Updated 35 tags in 0.058 seconds (synchronously).
easytags.vim 3.9.1: Highlighted tags in ~/someproject/code.c in 0.01 seconds (using Python).

Is it a bug in my config or in easytags? Or did I expect wrongly?

xolox commented 9 years ago

Hi @brainpower and thanks for the feedback. You read the documentation correctly, this seems to have been caused by a bug in vim-easytags (due to an oversight of mine). @cornerman created pull request #111 to fix this and I just merged the changes from that pull request so this issue should now be resolved.

Happy Vimming!

brainpower commented 9 years ago

A short test of mine shows that the issue indeed seems to be fixed.

Thanks @xolox and @cornerman