(forgot to CC vim_dev when replying to Lech Lorens :-S)
Hi Lech,
I looked into this internal error that I was able to reproduce and found
out that it was caused by the fact that I messed up the tags file. Could
it be that your tags file is malformed? More precisely: is it possible
that when you perform a tag search, there are some entries matching that
have multiple values for the same key (entries in tags files occupy one
line each, tags' properties are stored as "key:value", each pair
separated from the previous one with a tab character)?
If I understood you correctly you're referring to the list of optional
key/value pairs after the ;" sequence? I checked the buggy tags file in
Vim using the following pattern and found a line such as you described.
^.*;".*\s\(\w\+\):\S\+.*\s\(\1\)
The (only) match was on the last line of the tags file, which appears to
have been concatenated with a random other line from the tags file. This
meant that the "language:" field occurred twice on this line. The
relevant line is (everything between ---8<--- and --->8---):
---8<---
ystep /usr/include/python2.6/Imaging.h /^ int ystep;$/;" m
language:C struct:ImagingCodecStateInstance
access:publicCheckOptions
/home/peter/.vim/plugin/pyref.vim /^function! s:CheckOptions()$/;" f
language:Vim
--->8---
I stumbled upon this problem when calling taglist('.') so I guess that
makes every entry in the tags file a "matching entry" which means both
your assumptions hold.
In the scenario I investigated nothing bad aside from the error message
seems to be taking place. I'll prepare a patch soon.
The only complication is that I use exceptions for error handling in my
plug-ins so that Vim stops processing my scripts on the first error
message or exception.
Because my plug-ins use a :try/:catch block and one of the first steps
of some of my plug-ins is to get a list of all tags by calling
taglist('.'), the E685 error message is converted to an exception, which
means the result of the taglist() call is never assigned to a variable.
In other words, once a plug-in uses exceptions it becomes impossible to
read the valid entries from a corrupted tags file :-(
:set tags=~/.vimtags-buggy
:try
: echomsg "calling taglist()"
: let results = taglist('.')
: echomsg "called taglist()"
:catch
: echomsg "catched" v:exception
: " The {results} are never assigned.
:endtry
calling taglist()
catched Vim(call):E685: Internal error: hash_add()
Or did I miss another way to do this? By the way, thanks for the time
and effort you're putting into this problem and Vim in general :-)
- Peter Odding
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php