camspiers/snap

`preview = true` not working for ripgrep.file and vimgrep

zetashift opened this issue · 4 comments

Using this in my config(also 99% based off your config camspiers):

(snap.config.file:with { :preview true :consumer :fzf :layout layout.bottom :suffix :» }))
(snap.config.vimgrep:with { :layout layout.bottom :limit 50000 :suffix :» }))


  (snap.maps [

    [:<Leader><Leader> (file {:prompt "Find files" :producer :ripgrep.file : args}) {:command :find-files}]

    [:<Leader>fg (file {:prompt "Search Git Files" :producer :git.file}) {:command :git.files}]

    [:<Leader>ff (vimgrep {:prompt "Find in files"}) {:command :grep}]])

However there are no previews being shown?
image

EDIT: file is correctly installed and when I make a custom map with a customer preview.vimgrep a preview window is being shown!

If I do <C-h> then it does show the preview, it just doesn't persist/does it automatically:
image

Also another noobie question but is there anyway to get consistent (treesitter) highlighting in the preview?

I'm facing the same issue. The worked it out using those snap.run calls instead of the default ones, although I would prefer using the default version.

I just discovered that setting preview_min_width to a low value, say 0, brings the preview back. Maybe the threshold is too high?

the preview_min_width by default is set so that you must be able to see 80 cols for both the results view and preview view.