tagbar icon indicating copy to clipboard operation
tagbar copied to clipboard

Markdown: How to hide scopes?

Open wenchao-hao opened this issue 1 year ago • 4 comments

Seek for help: I want to use tagbar with markdown, but do not display the scope info of each title like following:

image

How to do to disable that display?

wenchao-hao avatar Feb 23 '24 07:02 wenchao-hao

This is controlled via the g:tagbar_show_data_type option. Please see the documentation for more information. https://github.com/preservim/tagbar/blob/12edcb59449b335555652898f82dd6d5c59d519a/doc/tagbar.txt#L772

raven42 avatar Feb 23 '24 15:02 raven42

This is controlled via the g:tagbar_show_data_type option. Please see the documentation for more information.

https://github.com/preservim/tagbar/blob/12edcb59449b335555652898f82dd6d5c59d519a/doc/tagbar.txt#L772

Thanks for your reply, but it seems not work.

I did not modify g:tagbar_show_data_type, the behavior would not change if I set g:tagbar_show_data_type to 0 explicitly.

What's more, if I set g:tagbar_show_data_type to 1 explicitly, it looks like following:

image

wenchao-hao avatar Feb 26 '24 01:02 wenchao-hao

Hmm. Ok I looked a little closer, and my memory was off. The behavior you are seeing is correct from the current implementation. The show_data_type was intended more for tags that have a data type from other languages like int var = 0; or similar where the datatype is derived from the word right before the tag. Which in the case of markdown does not appear to be very helpful.

That said, with the show_data_type set to 0 (default), then tagbar will populate this with the tag kind if it is a scoped kind (which section types in markdown are). From the current code, there is no way to disable this. Though an option probably could be added.

If we do get a chance to address this, are you wanting it to just be an empty string?

raven42 avatar Feb 26 '24 13:02 raven42

Hmm. Ok I looked a little closer, and my memory was off. The behavior you are seeing is correct from the current implementation. The show_data_type was intended more for tags that have a data type from other languages like int var = 0; or similar where the datatype is derived from the word right before the tag. Which in the case of markdown does not appear to be very helpful.

That said, with the show_data_type set to 0 (default), then tagbar will populate this with the tag kind if it is a scoped kind (which section types in markdown are). From the current code, there is no way to disable this. Though an option probably could be added.

If we do get a chance to address this, are you wanting it to just be an empty string?

Thanks, if possible, I want to make the display more clear, it's best to hide all contents after ":", including ":"

wenchao-hao avatar Feb 27 '24 01:02 wenchao-hao