Lech Lorens wrote: > > However, there's no reason to use 'tagfunc' for ^P/^N anyway. All > > we want there is tag names, and no need to disambiguate tags of the > > same name, so regardless, ^P/^N shouldn't use 'tagfunc'. Using > > tagfunc will also slow it down since all tags files are looked at > > rather than one at a time. > > In another email I have already responded to this claim. I believe > that 'tagfunc' could improve the results during the completion and so > its usage should not be disabled when completion is being done.
Good point. I guess it could act like a kind of intellisense, like only completing names of valid members of classes etc. A different flag should be passed to 'tagfunc' then when insert-mode completion is expected. Scripts not wanting to deal with it can just call taglist(). Actually I didn't check to see whether the 'c' flag (for context) was passed for ^P/^N. But I presumed it was, which was causing the problems. We should add the 'i' flag maybe for insert mode. Then my script will be able to tell the difference. Currently it will still require searching all files in 'tags' however. > > Another thing I noticed. If I tag to something that wasn't > > originally a tag (eg a local variable), then it starts off working. > > Then :tn also works, finding real tags. But :trew doesn't get back > > to the local var. That now seems lost from the list of tags. In > > fact, shouldn't :tselect show my local var tag first? I don't see > > it. I think it loses it when it goes to the next tags file in > > 'tags', but it shouldn't be doing that because my script already > > looked at all tags, as returned by taglist() which looks at all > > files in 'tags'. > > I've had a quick look at this one and I think I understand the cause. > Currently the tagging mechanism works in such a way that if e.g. > :tnext is executed, a list of tags is fetched anew and > current-index-+1-th tag is used for a jump. Really? But even vim's normal tagging gets tags in a different order depending on what file you're in. Eg it will find tags in the current file before others. Wouldn't that be a problem if the tag list was re-created for every :tn? > Fixing this will require ... your script to return a full list of > tags at each call (currently if a local variable is found, the > returned list does not include any more tags). Actually, even just changing this in the script would probably fix it. I suspect it must be keeping the list of tags between :tn etc, but updates the list when reaching the end and fetching the next entry in 'tags'. I figured if it was a local variable, then I could save the time spent getting tags, but meh, maybe it should just do it anyway. Thanks, Rob. -- Robert Webb <[email protected]>, Want to make polyhedra? http://www.software3d.com/Stella.php -- 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
