Skip to content

Commit

Permalink
Allow setting --preview-window to false to not override FZF defaults
Browse files Browse the repository at this point in the history
Currently when fzf_opts["--preview-window"] is set to false, it works as long as opts.preview_offset is not set.
But this is set for grep by default so it throws error. This checks if --preview-window is set before adding
preview offset to it.
  • Loading branch information
deathbeam authored and ibhagwan committed Feb 11, 2024
1 parent 5edef75 commit 91ec17b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/fzf-lua/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ M.build_fzf_cli = function(opts)
if opts.fzf_opts["--preview-window"] == nil then
opts.fzf_opts["--preview-window"] = M.preview_window(opts)
end
if opts.preview_offset and #opts.preview_offset > 0 then
if opts.fzf_opts["--preview-window"] and opts.preview_offset and #opts.preview_offset > 0 then
opts.fzf_opts["--preview-window"] =
opts.fzf_opts["--preview-window"] .. ":" .. opts.preview_offset
end
Expand Down

0 comments on commit 91ec17b

Please sign in to comment.