trouble.nvim
trouble.nvim copied to clipboard
Configurable diagnostics sorting
I'd like to sort diagnostics by line number. I see that right now diagnostics are sorted by severity here:
https://github.com/folke/trouble.nvim/blob/a2a7dbfefc5ebdf1a9c1d37e9df1d26a3b13c1cd/lua/trouble/providers/init.lua#L37-L47
That's done in an anonymous function. Do you think it would be reasonable to make this function configurable (so I can pass in my custom sorter)?
I'd also be interested in configurable sorting!
I patch the sorting like this:
https://git.sr.ht/~whynothugo/dotfiles/tree/main/item/home/.config/nvim/lua/_trouble.lua#L1-34
Making this function a config option would probably be the cleanest way to address that.
I've published a potential solution in https://github.com/folke/trouble.nvim/pull/190
Please give it a shot and let me know if it also works for your sorting criteria.