> Jason Aeschilman wrote: > > > > [ about the same tag being found in two tags files ] > > > > > > > Bram Moolenaar wrote: > > > > > First of all, it's recommended to upgrade to Vim 6.4. It includes many > > > > > bugfixes. > > > > > > > > > > But that doesn't solve this specific problem. I'll look into it. > > > > > > > > Bram, did you have a chance to look at this yet? > > > > > > Yes. It's not easy to figure out the full name of the file, so that > > > duplicate matches can be removed. I don't plan to do this for Vim 7.
Would you be willing to add an option in Vim 7 so that when it looks up a match that it'll only consult the first tags file listed and if a match is found, stop, else continue to the next tags file in the tags list? It seems by what the ctags author mentions in his FAQ that this was the way it worked once upon a time. I know that it worked this way in 6.2.457-1 (but then you said that was a bug). > > > > Does anyone else know if there is a setting to get the old behavior > > > > back? I simply want vim to look at only the local tags file and if a > > > > match is found to jump. If and only if there is no match in the local > > > > tags file, it will consult the parent tags file, according to the "set > > > > tags=tags;/" setting I have in my .vimrc. > > > > > > The "very old behavior" was in fact wrong in a few other ways, some tags > > > would not be found. Thus you can't get this back, you were depending on > > > a bug. > > > > First of all, I appreciate the help from you and Brett Stahlman. Thanks for > > following up on this. I'm a little confused though because in the help it > > says this under *tags-option*: > > > > The next file in the list is not used when: > > - A matching static tag for the current buffer has been found. > > - A matching global tag has been found. > > > > So if my tag is indeed in the current tags file, why would it even search > > the parent tags file? Again, my tags setting is "ctags=tags;/" as suggested > > in Tip #94 [http://www.vim.org/tips/tip.php?tip_id=94]. > > If you do ":tag ID" then the first found tag is used and Vim may not > report the other tags, as in "tag N of M". But if you do ":tselect" Vim > will find them all. ":tag ID" and :tselect" both return multiple matches for me. > > Even if I do "ctags --file-scope=no -R" in the parent directory and "ctags > > *.[ch]" in my sub-directory and I'm in my sub-directory, still it does not > > fix the problem. I even changed my tags option to 'set > > tags=./tags;tags;~/code'. These steps are part of the suggested solution by > > the ctags author, Darren Hiebert, as described in the ctags FAQ > > [http://ctags.sourceforge.net/faq.html#15]. I believe this is what Brett > > Stahlman was referring to. > > Whatever you set the 'tags' option to, you need to make sure tags appear > in only one tags file. If you use "../tags" then you don't need a tags > file in the current directory. Sure, I can have one global tags file for my whole project heirarchy and set my tags option to "tags;/" and it'll work but then I have vim giving me multiple matches when the same tag is found in several places. I just wanted to avoid that. It's just frustrating that things worked as I wanted in my old vim but not in the new one. I'll try vim 6.4 and 7.0 and see how they work. Thanks for your help.