Closed Shatur closed 2 years ago
We can use the --json
option for rg
.
NeoVIM 0.6 is going to offer an API to lua-cjson
. Means I would enable highlighting only if this API is available.
Means I would enable highlighting only if this API is available.
Just use vim.fn.json_decode
until 0.6. It will be slower, but will work.
We can use the --json option for rg.
But I talking only about highlighting of the matched part. It's already implemented in live_grep
.
I think now I got it :)
Can you give https://github.com/nvim-telescope/telescope-live-grep-raw.nvim/tree/feature-use-grep-sorter a try? It's using the default grep highlighter. Unfortunately it doesn't work if you run a more complex query. Utilising the JSON result for the sorter/previewer would be the best solution.
branch looks good. Thats only a workaround in telescope cores live_grep
right now. Move to json
is the way to go but was impossible with vim.fn.json_*
because we are in a fast context and cant call viml
at this point in time. schedule
would be bad as well. So we need a api-fast
function and vim.json
is exactly that
Can you give https://github.com/nvim-telescope/telescope-live-grep-raw.nvim/tree/feature-use-grep-sorter a try?
Thanks, just what I need!
Move to json is the way to go but was impossible with vim.fn.json_* because we are in a fast context and cant call viml at this point in time. schedule would be bad as well. So we need a api-fast function and vim.json is exactly that
Yeah... Hope 0.6 will be released soon.
Tested feature-use-grep-sorter
for a couple of days. Works and merged to master.
I am going to create a new issue for the preview using rg --json
(#4)
for reference: fzf Rg has no such issue
First of all thank you a lot for the awesome plugin! I have a suggestion. With live_grep the matched part is highlighted: But this plugin doesn't do it:
Could we implement it?