majutsushi/tagbar — Issue #66: Enable parsing of simple 'line number' tag addresses
Author: darcyparker
Created: 2012-02-21 22:00:37+00:00
State: open

Hi,

I would like to see tagbar support parsing simple line numbers from a tagline's tag address.

In autoload/tagbar.vim, it seems the s:ParseTagline() function assumes tag addresses are always patterns.

The [ctags format](http://ctags.sourceforge.net/FORMAT) says the tag address can be any ex command, but of course most people restrict the ex commands allowed because of security concerns. The spec recommends supporting either line numbers, or patterns. (It seems that tagbar only supports patterns if I am reading the source correctly.)

Can you add support for parsing line numbers (or better an ex command for line numbers & column numbers)?

FYI: The `ctag` command has an option `--excmd=number|pattern|mix` (Most people use `--excmd=pattern`)

Perhaps a special optional key could be added to `g:tagbar_type_{vim filetype}` that specifies the type of ex command the tag address will be? (ie `tagaddresstype="number" | "pattern" | "numberColumn"` )

The reason I am interested in this, is that I am nearly complete a custom ctags generator for XSLT. I found that regex's don't work well for finding/tagging XSLT. (See [ stackoverlow ](http://stackoverflow.com/questions/6466928/is-there-a-ctags-like-tool-for-browsing-navigating-xslt-code-in-vim/9217128#9217128) ) So I decided to create my own using XSLT. Specifying the tag address is challenging because regex's don't work well, so I decided to use line numbers because I can get this info from the XML parser. I also toyed with the idea of using an ex command for navigating by XPath. But that would require a special vim plugin... Since line 'numbers' is a recommendation/option in the ctags format spec, I decided to go with line numbers.

I have my XSLT ctag generator hooked up to tagbar nicely. However, I discovered that tagbar doesn't recognize line numbers for the tag address.

So I would really appreciate it if tagbar could implement line numbers for tag addresses. And even better, it would be cool if you could receive an ex command for navigating to a line number and column.

Thanks
Darcy