Hi Robert,

Thanks for your reply.

> I would have to see the full context.  I use it all the time and it works
> well for the majority of cases, but there are always things that can trip it
> up, and it depends a lot on the contents of your current file and the file
> containing any matching tags.
>
> Send me your .cpp file (and .h file if required) and tags file, in case mine
> generates differently.  And I'll see what I can see, though it's been a
> while since I looked at this.

Hmmm, I investigated a bit further & discovered that the search
pattern in the tags file appears to match multiple lines in the source
file:

devaus120>> grep ::func tags
Derived1::func  test.cc /^    virtual void func (void) const$/;"
 f       class:Derived1  signature:(void) const
Derived2::func  test.cc /^    virtual void func (void) const$/;"
 f       class:Derived2  signature:(void) const

Here is the source:

class ABC
{
public:
    virtual void func (void) const = 0;
};

class Derived1 : public ABC
{
public:
    virtual void func (void) const
    {
    };
};

class Derived2 : public Derived1
{
public:
    virtual void func (void) const
    {
        Derived1::func();
    };
};

When I put cursor on "Derived1::func();", SmartTag takes me to the
implementation of Derived2::func(). ie 2 lines above the cursor. Which
is a bit strange cos that must mean that the search finds the *last*
occurance of the search pattern.

Here is my tags file, generated with: ctags --extra=fq --fields=+iS test.cc

!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not
append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Darren Hiebert  /[email protected]/
!_TAG_PROGRAM_NAME      Exuberant Ctags //
!_TAG_PROGRAM_URL       http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION   5.6     //
ABC     test.cc /^class ABC$/;" c       file:
Derived1        test.cc /^class Derived1 : public ABC$/;"       c
 file:   inherits:ABC
Derived1::func  test.cc /^    virtual void func (void) const$/;"
 f       class:Derived1  signature:(void) const
Derived2        test.cc /^class Derived2 : public Derived1$/;"  c
 file:   inherits:Derived1
Derived2::func  test.cc /^    virtual void func (void) const$/;"
 f       class:Derived2  signature:(void) const
func    test.cc /^    virtual void func (void) const$/;"        f
 class:Derived1  signature:(void) const
func    test.cc /^    virtual void func (void) const$/;"        f
 class:Derived2  signature:(void) const
test.cc test.cc 1;"     F

Scott.

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