Yegappan Lakshmanan wrote:
Hi Yakov,

On 6/18/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
How can I determine [in vim function] that my current line
number corresponds to the definition of tag X ?

Do I need to parse tags-file for that, or I can get it using
existing vim functions ?


You need to parse the tags file and use the line numbers stored
in the tags file for each tag. If the tags file is sorted, then you can
do a binary search. Otherwise you have to do a linear search.

You can look at the Tlist_Find_Nearest_Tag_Idx() function in
the taglist plugin for an example.

http://vim.sourceforge.net/scripts/script.php?script_id=273

- Yegappan



The tags file doesn't always have line numbers in it. In many cases (such as the Vim help tags files) it has a search command instead.

But what was Yakov asking? "I am moving the cursor, have I arrived at the definition for tag foobar?" or "Is there a tag definition, and which one, on the current cursor line?" ?


Best regards,
Tony.

Reply via email to