Here is a file -- ChipBooter.cpp
-- in my project(Omit some details that are not related to this question):
class ChipBooter {
public:
void Boot() {
this->DpDetect();
}
void DpDetect() {}
}
When I hit g<C-]>
to jump to the definition of DpDetect
, Vim displayed a list with duplicate matching tags:
# pri kind tag file
1 F C f DpDetect OMU/src/boot/src/ChipBooter.cpp
class:ChipBooter
void ChipBooter::DpDetect()
2 F C f DpDetect OMU/src/boot/src/ChipBooter.cpp
class:ChipBooter
void ChipBooter::DpDetect()
This is the same definition!
This problem happens every time I hit g<C-]>
and always doubles the length of the list.
More Details
Exuberant Ctags version: 5.8
. Vim version is 7.3
Here is a visual representation of my directory hierarchy:
Source
`---tags
|
`---OMU
`---src
`---boot
`---src
`---ChipBooter.cpp
I ran ctags -R
in Source
which contains the OMU
directory to generate the tags
file.
I launch vim using vim -u NONE -N
; .vimrc
and plugins is disabled.
There is only one entry about DpDetect
in the tags
file:
DpDetect OMU/src/boot/src/ChipBooter.cpp /^void ChipBooter::DpDetect()$/;" f class:ChipBooter
tags
is default value, because .vimrc
is disabled.
:set tags?
tags=./tags,./TAGS,tags,TAGS
Update
@romainl said Vim seems to be using both two tags files: tags
and TAGS
.
:echo tagfiles()
['tags', 'TAGS']
If I change tags
option to exclude TAGS file(:set tags=./tags,tags
), duplicate tags problem does not exist.
Where is the TAGS
file? There is only a tags
file in my project directory.
$ find {My project root directory} -iname tags
./tags
:echo tagfiles()
?tags
andTAGS
. Do you have aTAGS
file in/home/yufeng/mount/svncode/omu/zycp/Source/
? Could it be a case-sensitivity issue?tags
file and then asking for aTAGS
file. A case-sensitive FS would answer yes to both question, forcing Vim to search two times in the same file thinking there are two, while a case-insensitive FS would answer yes only to the first question.