Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 90 by [email protected]: incorrect parsing of exuberant ctags tags file
http://code.google.com/p/vim/issues/detail?id=90

What steps will reproduce the problem?
1. cd into vim/src
2. Run ctags with case folding(ctags -R --sort=foldcase)
3. Open vim/src/main.c
4. Either run:
    :set tags=tags
   Or your vimrc will need to be set to load the tags file
5. Go to line 208, and try to jump to definition for mch_fopen (CTRL-] is the specific command I'm using to try to jump)
       E432: Tags file not sorted: tags
       E426: tag not found: mch_fopen

What is the expected output? What do you see instead?

I'd expect to follow jump to the definition of mch_fopen. I get the errors list above instead
      E432: Tags file not sorted: tags
      E426: tag not found: mch_fopen

What version of the product are you using? On what operating system?

    Centos6 up todate as of yesterday
    vim hg pull -u from a few days ago
    Features: huge
Both python and ruby enabled and pointing to pythonbrew and rvm installations
        VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 30 2012 16:11:40)
        Included patches: 1-712
   ctags version: 5.8

Please provide any additional information below.

If you look at the tags file you'll see a line at the top starting:
   !rm
Which due to foldcase has been sorted before the "!_TAG_XXXXX" lines.
This is valid tags file according to: http://ctags.sourceforge.net/FORMAT
Written by Bram and Darren Hiebert

Particularly:

The names of the tags used in these lines may be suitably chosen to ensure that when sorted, they will always be located near the first lines of the tag file. The use of "!_TAG_" is recommended. Note that a rare tag like "!" can sort to before these lines. The program reading the tags file should be
    smart enough to skip over these tags.

Vim is failing to read far enough into the file and assumes that the file isn't sorted even though it is, which then leads down to further errors and not finding the tag that is there. I looked a few weeks ago at tag.c I think TS_START is getting unset too soon (though it might need more work than that). Vim might need to readjust how it searches when it finds "!_TAG_XXXX" lines. I didn't have the time to try coming up with a patch (or even to file a bug until today....)

If you don't set ctags to foldcase things will work (maybe not as fast a tags lookup when ignorecase is set). I have a few other source trees I'm working with that have some other rare tags that get sorted above the "!_TAG_XXXX" set of lines, and seen similar problems.

--
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

Raspunde prin e-mail lui