-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
feat(pickers): implement group-by. #2771
base: master
Are you sure you want to change the base?
Conversation
@griwes thanks so much for the implementation, i am quite unfamiliar with lua, do you know how can someone try this code in their personal neovim config? Please @Conni2461 could you review this PR? This feature would be awesome, order the results by filename just like VsCode. |
I'm a little per-occupied to review bigger features at the moment but rest assured I haven't forgotten about this. @jugarpeupv probably just replacing If more people want to give this a test, that'll be appreciated as well. |
@jamestrew i tried to test this with your indications but an error arises, i do not understand why (see the image) @griwes thank you for the implementation, I was wondering if you could provide an example on how to invoke the live_grep command, i was reading the code and i guess i would figure it out but i would appreciate it since I am still not quite familiar with how telescope pickers work. |
@jugarpeupv you didn't write the correct branch name |
@max397574 thank you! i managed to get it to work, it is just what i was looking for @jamestrew hope this get merged soon |
@griwes one thing i would suggest is to hide fileicon on the registries, since we can see the filetype icon on the header. It is just to see less icons which does not supply relevant information |
@jugarpeupv you can also pass in As to extensions, if they accept and pass through the arguments passed into them to the picker, this should also work there. If they don't, there really isn't much that can be done other than modifying the extensions. |
@griwes I just tested with path_display but i do not see the results :S As to extensions, i deleted the comment because i managed to get it working with the extension live_grep_args, just passing group_by = "filename", so it is fine Thank you for your quick reply ^^ |
@griwes i just added path_display = "hidden" to the telescope global config and i can see the result, but this is not what i was talking about. I was pointing that the icons shown in the registries might be omitted, but in the registries, not in the header |
Ah right, I forgot that path_display doesn't hide the icons; there's a separate option called |
i don't think this should be in the documentation so it doesn't get to big |
@griwes disable_devicons is working as i expected, thank you. |
@jamestrew any chance you could give this a cursory glance soon-ish? I haven't looked at what the current conflicts are yet, but I'd like to rebase this in the near future and would love some initial feedback, specifically as to whether the approach in this PR is generally acceptable or if something fundamental would need to change, ideally before I start rebasing. |
👀 |
@griwes @jamestrew any updates on this? |
Description
This PR implements a feature to enable having a grouping of entries have a "header" indicating the common field. This is very similar to what telescope-egrepify does display-wise, but fully configurable to allow grouping by arbitrary entry properties (to be fully honest, I don't right now know when I'd use this with anything than
filename
, but making this general was easy enough), and to allow the customization of the display of those headers.Noteworthy points:
virt_lines
set to the header text, andvirt_lines_above = true
. However, for the very first header that does not currently work due to the neovim bug, so as a workaround I insert an additional blank line into the results buffer, and place an overlay extmark there. This complicates some of the math, but after fighting many, many off-by-one errors, I think I've got it right at this point?_clear_extra_rows
makes sure that the ascending sorting direction still has its extra rows cleared when it is atmax_results
.Type of change
Resolves #2297
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration
Extensively manually tested a roughly complete cartesian product of:
live_grep
andlsp_references
group_by
argument being a string, or a table with overridespath_display = "hidden"
Configuration:
NVIM v0.10.0-dev-324fad1
Checklist: