Skip to content

Commit

Permalink
fix: auto-preview rotation in split mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Apr 3, 2024
1 parent 78d25f8 commit 7ecc8e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/fzf-lua/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,15 @@ M.fzf = function(contents, opts)
opts.keymap = opts.keymap or {}
opts.keymap.fzf = opts.keymap.fzf or {}
opts.keymap.fzf["zero"] = previewer:zero()
-- Only enable flex layout native roitate if zero event wasn't
-- set as it's most likely set by the default builtin previewer
elseif opts.__FZF_VERSION
end
if opts.__FZF_VERSION
and opts.__FZF_VERSION >= 0.46
and opts.winopts.preview.layout == "flex"
and tonumber(opts.winopts.preview.flip_columns) > 0
-- Only enable flex layout native rotate if zero event wasn't
-- set as it's most likely set by the default builtin previewer
-- or when using split mode for the background "empty previewer"
and (not previewer.zero or opts.winopts.split)
then
local transformer = string.format(utils.__IS_WINDOWS
and "IF %%FZF_COLUMNS%% LEQ %d (echo change-preview-window:%s) "
Expand Down

0 comments on commit 7ecc8e3

Please sign in to comment.