preservim / tagbar

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

Add option for g:tagbar_highlight_method #709

Closed raven42 closed 3 years ago

raven42 commented 3 years ago

Closes #708

Add option for g:tagbar_highlight_current_tag which will allow highlighting of tags on the current line in addition to highlighting the scoped tags. Reverts the behavior added in #683 to the default from before that commit

raven42 commented 3 years ago

Reworked to use a different configuration of g:tagbar_highlight_method instead which can be set to one of 'nearest' / 'nearest-stl' / 'scoped-stl' to highlight the appropriate tag.

Shane-XB-Qian commented 3 years ago

actually even 'nearest' looks now is better, if current line no tag then it will highlight nearest above one. https://github.com/preservim/tagbar/issues/708#issuecomment-725459627 "to me, to show the parent func name (if cursor in that scope) is more important than show tag in same line." // we did it now. thx buddy @raven42 we've work this out. :+1:

raven42 commented 3 years ago

Glad we could get things working for you again.

Shane-XB-Qian commented 3 years ago

for everybody actually :+1: // #683 was hardcode to 'nearest-stl' only.. now, even 'nearest' looks is better. for example, even for 'c' (vs 'golang'), following c code, if cursor was Not on a macro (on its next line), it was hightlighted nothing, now with 'nearest', it can hightlight nearest above one. should be a bit more make sense now.. :)

static char *(main_errors[]) =
{
    N_("Unknown option argument"),
#define ME_UNKNOWN_OPTION   0
    N_("Too many edit arguments"),
#define ME_TOO_MANY_ARGS    1
    N_("Argument missing after"),
#define ME_ARG_MISSING      2
    N_("Garbage after option argument"),
#define ME_GARBAGE      3
    N_("Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"),
#define ME_EXTRA_CMD        4
    N_("Invalid argument for"),
#define ME_INVALID_ARG      5
};
Shane-XB-Qian commented 3 years ago

and .stl still was an issue actually, and not only for 'golang'.. // different ctags args configured different value in different places, and ctags_bin auto detection override the configure one.. // looks such situation would make 'nearest-stl' (which depeneds on .stl) behaviour a little flaky.. anyway/so yes, i preferred 'nearest', wish it kept working always..