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

list index out of range #13

Closed ssoriche closed 13 years ago

ssoriche commented 13 years ago

I'm starting to see this error message a lot:

easytags.vim: Vim(let):E684: list index out of range: 1 (at function xolox#easytags#autoload..xolox# easytags#file_has_tags..39_cache_tagged_files..39_cache_tagged_files_in, line 2)

I have the following settings in my .vimrc as I want each project to have its own tags file:

let g:easytags_cmd = '/usr/local/bin/ctags' let g:eastags_dynamic_files = 1 let g:easytags_file='./.vimtags'

Please let me know if there's any other data I can provide.

~Shawn

xolox commented 13 years ago

Hi Shawn,

I think that either you have a corrupt tags file or you got bitten by a bug which has since been fixed. Either way the newest release (see above, also available as version 2.4.5 on Vim Online) contains some changes that make the plug-in fail more gracefully in this situation, so please try it out. If the problem hasn't been fixed the problem should now be a lot less disruptive to your workflow (sorry about that...) and the plug-in will tell you which of your tags files contains corrupt lines.

Peter

ssoriche commented 13 years ago

Hi Peter,

Thanks again for getting back to me SO quickly on this issue.

I'm still getting an error message but now I know exactly what the problem is and am able to address it.

The interesting thing is that the .vimtags file that's causing the problem is not the .vimtags in the current directory but the one in my home directory. I'm guessing that Vim is still reading it, even though I told it to use the one in the current directory.

I'm going to delete that file and see if that makes the error message go away.

Once again, thank you for the excellent support.

~Shawn

xolox commented 13 years ago

Hi Shawn,

The interesting thing is that the .vimtags file that's causing the problem is not the .vimtags in the current directory but the one in my home directory. I'm guessing that Vim is still reading it, even though I told it to use the one in the current directory.

The easytags plug-in updates only a single tags file at a time* but it reads all tags files known to Vim** when the plug-in is first used and when tags are highlighted in a buffer. This is the reason that the plug-in gave an error about ~/.vimtags even though you're using the easytags_dynamic_files option (I guess?).

* Disregarding for a moment the recently introduced support for file type specific tags files. ** The tags files listed in Vim's 'tags' option and returned by the function tagfiles().

ssoriche commented 13 years ago

Sounds reasonable to me.

Thanks again!

~Shawn