Open rockyzhang24 opened 2 years ago
Highlighting in the results window is actually performed by a fzy sorter.
Essentially, somebody would have to pick up https://github.com/nvim-telescope/telescope.nvim/pull/1448
Thanks. Btw, I installed fzf extension as the sorter. I know that find_files
will use fzf, how about live_grep
and grep_string
?
Should I try telescope-rg.nvim?
Ah, I was too brief. The fzy sorter for highlighting pretty much only gets the offsets of matched prompts for highlighting but does not perform any sorting per se.
live_grep
therefore doesn't practically speaking have any sorter. grep_string
passes the string (also possibly an empty string) onto rg
and then filters that one using your sorter.
Should I try telescope-rg.nvim?
I think the author originally planned on picking up the PR but never came around. That's why I mentioned somebody has to pick it up :) in the long run, in open source people ideally implement the features they want to see implemented (or generally have fun implementing stuff, of course).
Thank you @fdschmidt93 so much for your clear explanation.
On more question (or issue) here still for live_grep
highlight.
When I type a query string, say main
, only the files containing main xxx
will be listed and main
should be highlighted. However, if a file has name like main.go
and its content has main xxx
, highlight will be misplaced, i.e., main
in the filename will be highlighted instead of the actual content. Is this a bug?
@fdschmidt93 I am not sure whether this problem is related to this issue, do I need to open another issue? Thank you very much.
It's pretty much the same issue. If we got our highlighting from rg
directly that issue would be fixed. I'd say you're happy to open another issue for that, though in practice would have the same solution I guess.
Okay, I got it. Thanks.
Is there any progress? 👀
Yes there is progress here. One of our team members made a wip pr https://github.com/nvim-telescope/telescope.nvim/pull/2536
I hope we can finish this one soon
Description
In
live_grep
, when I type a regex string as query after the prompt, no highlight for the matching in the results window.Neovim version
Operating system and version
macOS 12.1 (the latest)
checkhealth telescope
Steps to reproduce
live_grep
Expected behavior
All the matching should be highlighted as well when the query is regex.
Actual behavior
However, if I type a normal string as a query, all the matching will be highlighted
Minimal config
The default config.