Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown: How to hide scopes? #870

Open
wenchao-hao opened this issue Feb 23, 2024 · 4 comments
Open

Markdown: How to hide scopes? #870

wenchao-hao opened this issue Feb 23, 2024 · 4 comments

Comments

@wenchao-hao
Copy link

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?

@raven42
Copy link
Collaborator

raven42 commented Feb 23, 2024

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

g:tagbar_show_data_type~

@raven42 raven42 closed this as completed Feb 23, 2024
@wenchao-hao
Copy link
Author

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

g:tagbar_show_data_type~

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

@raven42
Copy link
Collaborator

raven42 commented Feb 26, 2024

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?

@wenchao-hao
Copy link
Author

wenchao-hao commented Feb 27, 2024

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 ":"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants