-
-
Notifications
You must be signed in to change notification settings - Fork 857
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
live_grep highlighting shouldn't be fuzzy or include the filenames #2272
Comments
+1 for this issue. |
Rather than taking the colored rg output and parsing ansi color codes, we could use either the
What we choose for the delimiter would matter though to prevent over matching on the telescope side when parsing the entries. I can work on this. |
vim.json is fast and makes parsing very simple and now also has documentation on master HEAD. Performance for non-luajit should be quickly benched though, but I dont see (yet) how it would make things slower than the current approach. |
Yeah I'm reconsidering and leaning towards using And frankly, this repo's been a bit cold in terms of maintainer activity so I don't have a ton of motivation to spend a good chunk of time on something only for it to be forgotten in the stack of PRs. |
You can also refer to the entry maker of https://github.com/fdschmidt93/telescope-egrepify.nvim as well which uses |
I did take a peek actually when working on the entry maker 😁 The tricky part is how to deal with certain options that will conflict with For the first three file related flags, we should be able to use the The count flags we won't be able to support (and we never did) without it's own entry maker I think. I'm not going to bother with that but I probably want to throw an error message at least. |
Description
The default behavior of
live_grep
is to pass it torg
as a regex. Usingrg
from the cli, its highlighting highlights matches of that regex in the results.Using the default options for
live_grep
, the sorter uses the fuzzy highlighter on the result: https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/sorters.lua#L491-L493.This results in highlighting that is rather nonsensical. As a visual cue, it actually makes it look like the search is broken (to be clear, it's behaving correctly, it just looks like it's not).
I'm happy to take a stab at a PR, but it'll be towards the end of the year. I'm curious if it's possible to capture the output of
rg
with color and treat ansii escapes as "quotes". That would be ideal IMO, as thentelescope
wouldn't need to attempt any logic around it, simply delegating it to ripgrep. However, if that's not possible, at least a default that splits the string after the filename/index part and does a regex match on that would be an improvement.Neovim version
Operating system and version
Arch Linux - 5.15.81-1-lts
Telescope version / branch / rev
76ea9a8
checkhealth telescope
Steps to reproduce
Any search with regex characters
Expected behavior
Highlighting would highlight the terms within the text that matched the search
Actual behavior
Highlighting highlights... some stuff
Minimal config
The text was updated successfully, but these errors were encountered: