majutsushi/tagbar — pull request #65 by wuzzeb (2012-02-19 16:51:54+00:00)
Title: [RFC] Manualscope

This is more a request for comments to see if you like this approach. The problem was mentioned in issue 34 (https://github.com/majutsushi/tagbar/issues/34) that ctags with regexes doesn't support scope, but LaTeX is much nicer when subsections are inside sections in the tagbar. I didn't want to write a ctags plugin for LaTeX so I thought instead to modify tagbar to just always put subsections inside the containing section and this is the result.

I thought about adding entries to the fields of the tags that look like normal scope when parsing the tag file and then use all the existing code for kind2scope to match children with parents and display, but couldn't get this approach to work... I could set the scope fields correctly but the tags didn't display for some reason which I never figured out.

Right now there is no folding, something that could be added perhaps.

Right now it doesn't really support nesting properly, in the sense that you can't say that a label should be nested inside the nearest subsection or section or chapter depending on which is nearest. This wouldn't be hard to add, just look at line numbers.

Another option would be to not put any code in tagbar and instead write a small script that adds scope tags to the output of ctags...