Skip to content

Commit 7ecc8e3

Browse files
committed
fix: auto-preview rotation in split mode
1 parent 78d25f8 commit 7ecc8e3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lua/fzf-lua/core.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,15 @@ M.fzf = function(contents, opts)
343343
opts.keymap = opts.keymap or {}
344344
opts.keymap.fzf = opts.keymap.fzf or {}
345345
opts.keymap.fzf["zero"] = previewer:zero()
346-
-- Only enable flex layout native roitate if zero event wasn't
347-
-- set as it's most likely set by the default builtin previewer
348-
elseif opts.__FZF_VERSION
346+
end
347+
if opts.__FZF_VERSION
349348
and opts.__FZF_VERSION >= 0.46
350349
and opts.winopts.preview.layout == "flex"
351350
and tonumber(opts.winopts.preview.flip_columns) > 0
351+
-- Only enable flex layout native rotate if zero event wasn't
352+
-- set as it's most likely set by the default builtin previewer
353+
-- or when using split mode for the background "empty previewer"
354+
and (not previewer.zero or opts.winopts.split)
352355
then
353356
local transformer = string.format(utils.__IS_WINDOWS
354357
and "IF %%FZF_COLUMNS%% LEQ %d (echo change-preview-window:%s) "

0 commit comments

Comments
 (0)