camspiers / snap

A fast finder system for neovim.
The Unlicense
483 stars 16 forks source link

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

Closed zetashift closed 10 months ago

zetashift commented 3 years ago

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!

zetashift commented 3 years ago

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?

mactep commented 3 years ago

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.

mactep commented 3 years ago

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

camspiers commented 10 months ago

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.