telescope results line color / highlight
Is your feature request related to a problem? Please describe. The ability to change the color of the line next to the line numbers (the red one in the screenshot) without effecting the normal text.
Describe the solution you'd like A new highlight group to change the color.
Describe alternatives you've considered
I changed TelescopeResultsNormal, but that also affects other text.
Additional context
There technically is a separator_hl option deep inside the results entry creation mechanism that you could take advantage of but it's pretty inaccessible at the moment and none of the builtin pickers utilize it so I'm an agreement that it's probably better to just have a hl group for the separator.
But this is pretty low priority for me personally. If someone wants to have a go at it, I'd be willing to offer some help.
@jamestrew, do you mean this piece of code?:
By creating a new hl_group, do you mean to make it and add it as default like the others?
Also, how did you configure the line next to the number? By default, I have only the line number and not the separator @sand4rt
@MovieMaker93 that's right.
https://github.com/nvim-telescope/telescope.nvim/blob/5665d93988acfbb0747bdbf4f4cb583bcebc8930/lua/telescope/make_entry.lua#L925-L932
We could technically make current_buffer_fuzzy_find and other pickers using entry_display take a separator_hl option but I feel like just adding a new hl group, something like TelescopeResultsSeparator would be a cleaner way.
@MovieMaker93 that's right.
https://github.com/nvim-telescope/telescope.nvim/blob/5665d93988acfbb0747bdbf4f4cb583bcebc8930/lua/telescope/make_entry.lua#L925-L932
We could technically make
current_buffer_fuzzy_findand other pickers usingentry_displaytake aseparator_hloption, but I feel like just adding a new hl group, something likeTelescopeResultsSeparatorwould be a cleaner way.
Thanks for the answer. I'm trying to understand how the highlighters work for the pickers, but I haven't fully grasped it yet.
I've added the new hlgroup here: https://github.com/nvim-telescope/telescope.nvim/blob/5665d93988acfbb0747bdbf4f4cb583bcebc8930/lua/telescope/pickers.lua#L73-L84
and as default here:
https://github.com/nvim-telescope/telescope.nvim/blob/5665d93988acfbb0747bdbf4f4cb583bcebc8930/plugin/telescope.lua#L18-L22
However, I don't know where to specify this hlgroup option. I didn't understand where the popup_opts has been defined or how to define the new hlgroup besides the one place specified above.
Could you guide me further on how to do it?
On second thought, maybe TelescopeResultsEntrySeparator might be clearer.
However, I don't know where to specify this hlgroup option.
I think you could just do something like
configuration.separator_hl = vim.F.if_nil(configuration.separator_hl, "TelescopeResultsEntrySeparator")
at the top of the entry_display.create function. This should add the highlight group to a table of highlights for the entry.
The actual setting of the entry highlights happens closer to here: https://github.com/nvim-telescope/telescope.nvim/blob/c2ce039188e22288449e43b77710036e69a45a70/lua/telescope/pickers.lua#L1264-L1300
The hi_display function will loop over the table of highlights and call nvim_buf_add_highlight