preservim / tagbar

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

shane: compact tag line# should be good enough if user set it #687

Closed Shane-XB-Qian closed 4 years ago

Shane-XB-Qian commented 4 years ago

pr for #684 short/compact '[123]' should be good enough.. if user opened set 'g:tagbar_show_tag_linenumbers', he/she should be awared that is a linenum already. // the pattern [0-9]* for hl was not accurate, line# should be always existed or there was no that tag existed. @raven42 pls review, and merge if ok.

Shane-XB-Qian commented 4 years ago

@raven42 just like we talked at #686, we'd better just short version and/or that should be good enough for this at least. otherwise, would become another historical issue again .. -_-# we did not need so many options.. :)

alerque commented 4 years ago

I think I'm okay with a short syntax by default (since this is off-by-default people enabling it will understand what they are getting, but honestly any use of # and even the brackets is feeling cluttered to me. Have we tried just an upper cases L prefix like L14? This would be more in line with GitHub's and many other code viewing UIs and links, I think it might be a more familiar notation than any parenthesis, brackets, or hashes. I realize a lot of code debuggers also use lowercase l for this, but they often do so with a colon as well l:14.

Shane-XB-Qian commented 4 years ago

L123 looks ok, but put tag name e.g SqFooFunc L123 or L123 SqFooFunc, that perhaps looks a bit confused. so far, looks [123] is better choice.

raven42 commented 4 years ago

Ok sure. I'm fine with any approach. This looks ok to me.

Shane-XB-Qian commented 4 years ago

@raven42 i means if g:tagbar_show_tag_linenumbers had 3 or 4 etc, then g:tagbar_compact probably should have 3 too.. or let it be all...

@alerque L123 can be a func/var name too in most coding langs, but [123] mostly can not, so perhaps [123] better.

Shane-XB-Qian commented 4 years ago

as for the pattern [0-9]* in the code, looks it should be [0-9]\+. ok, this is all about this pr, for compact showing line# and this pattern correction.

raven42 commented 4 years ago

merged in... thanks for the contribution

Shane-XB-Qian commented 4 years ago

thx for merged. though there was perhaps a bit flaw actually, if set this on and line# showed at right, looks it took same 'syn highlight' like 'parameter' or 'return type' etc such strings of ori func/tag; but this is regardless compact or not, not an issue, just maybe would not look very nice/perfect.

Shane-XB-Qian commented 4 years ago

not an issue, just maybe would not look very nice

pr #701 opened for this.