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

Sort by order in the file #854

Open
bluss opened this issue Jul 31, 2023 · 2 comments
Open

Sort by order in the file #854

bluss opened this issue Jul 31, 2023 · 2 comments

Comments

@bluss
Copy link

bluss commented Jul 31, 2023

Would it be possible to add an option to sort items by strict order in the file?

Right now I see classes sorted first and then functions. If I enable tag linenumbers (let g:tagbar_show_tag_linenumbers = 1) then the displayed line number corresponds to exactly the order that I'd prefer in the tagbar, if the items were sorted by that line number. Is this possible? Any pseudotags could be sorted according to their first child.

(The sort option only influences order inside a category, that I can see, i.e "class", "function" etc.)

@alerque
Copy link
Member

alerque commented Jul 31, 2023

Off the top of my head I don't know how hard this would be to implement, but we'd be happy to accept a PR if somebody wanted to implement this as an option. The semantic tag data should have enough information to construct this (since it has line numbers) but it might be kind of a pain to iterate though.

@raven42
Copy link
Collaborator

raven42 commented Jul 31, 2023

Take a look at the 'g:tagbar_sort' option. Is that what you are wanting?

Edit: oh sorry. Missed the bit at the end that you had looked at that.

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

3 participants