Wednesday, January 30, 2013

Re: ctags processing jumps to wrong tag?

On Wednesday, January 30, 2013 12:02:19 PM UTC-6, Ben Fritz wrote:
>
> I found a reasonable workaround for my uses. Using the -B flag to ctags
> generation generates backwards search patterns from the end of the file,
> so always the last occurrence (the function definition) is found instead
> of always the first (the function prototype). This makes the prototype for
> these functions inaccessible via tag jumping, but normally I want the
> function definition anyway so it's less of an issue than the behavior
> without -B.
>
> I may experiment sometime to see if I can generating ONLY prototype tags
> and append them to a tags file generated without prototypes. Then I could
> use forward search for prototypes and backwards search for definitions.

Forward searching prototypes and backward searching functions is actually
really easy, I found. Just invoke ctags twice, as follows:

!"C:/Documents and Settings/ben/ctags58_win32/ctags.exe" --extra=+f --fields=+SK-k --totals -B %
!"C:/Documents and Settings/ben/ctags58_win32/ctags.exe" --extra=+f --fields=+SK-k --totals --c-kinds=p -a %

Now I can access both the prototype and the function definition regardless
of how similar the location pattern!

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: