preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.12k stars 486 forks source link

[bug] improper ctags argument ordering #776

Closed XSven closed 3 years ago

XSven commented 3 years ago

This example tagbar debug output

2021-06-23 07:49:50.071215: ctags_args (is a list): ['--extras=+F', '-f', '-', '--format=2', '--excmd=pattern', '--fields=nksSafet', '--sort=no', '--append=no', '-V', '--options=~/.vim/ctags/perl.ctags', '--language-force=perl', '--perl-kinds=pcMflds']

shows that a g:tagbar_ctags_options setting that leads to --options=~/.vim/ctags/perl.ctags comes before --perl-kinds=pcMflds . With this order it is not possible to turn of kinds like for example p configuring --kinds-perl=-p in the ~/.vim/ctags/perl.ctags file. I would assume that ctags options specified via a g:tagbar_ctags_options should come last and have higher precedence than the ctags options prepared by the tagbar plugin itself.

This is how you can test it. Create a file Foo.pm with the content package Foo;. Then run either

ctags -o - --kinds-perl=-p --perl-kinds=p Foo.pm
Foo     Foo.pm  /^package Foo;$/;"      p

or this

ctags -o - --perl-kinds=p --kinds-perl=-p Foo.pm
# no output