diff --git a/lua/fzf-lua/core.lua b/lua/fzf-lua/core.lua index 164ca100..24dd0b18 100644 --- a/lua/fzf-lua/core.lua +++ b/lua/fzf-lua/core.lua @@ -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) "