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

Custom function for sorting #144

Closed
sashalikesplanes opened this issue Jul 16, 2023 · 3 comments · Fixed by #145
Closed

Custom function for sorting #144

sashalikesplanes opened this issue Jul 16, 2023 · 3 comments · Fixed by #145

Comments

@sashalikesplanes
Copy link
Contributor

I am trying to use a buffer line to show the current files I have marked using harpoon.

I want the buffers to be in the same order as in harpoon, is it possible to provide cokeline with a custom sorting function? In the code for buffers I only see functions for the default sort orders.

@willothy
Copy link
Owner

willothy commented Jul 16, 2023

Currently you can only use the builtin functions. I should change that though, I'll add the ability to specify a function in the config as well.

EDIT: See note on the PR

@sashalikesplanes
Copy link
Contributor Author

sashalikesplanes commented Jul 16, 2023 via email

@willothy
Copy link
Owner

willothy commented Jul 16, 2023

That’s awesome! Thanks for such a quick fix! You rock!

Thanks! Just happened at a convenient time and was pretty quick to implement. Btw I liked your idea so I implemented a Harpoon sorter:

https://github.com/willothy/nvim-cokeline/wiki#harpoon-based-sorting

EDIT: Wow this was a really good idea, I will be using this harpoon sorter from now on! Doesn't event break hover events and rearranging non-pinned buffers still works. Plus when you rearrange buffers in Harpoon they rearrange in the tabline.

Also, if you happen to create any cool sorters of your own, please share them via a PR or the wiki! :)

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

Successfully merging a pull request may close this issue.

2 participants