Skip to content

Commit 13513d6

Browse files
committed
fix(win): updated win ref in resize event (#2255)
1 parent f579824 commit 13513d6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lua/fzf-lua/core.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,10 @@ M.fzf = function(contents, opts)
374374
.. libuv.shellescape("resize:+transform:" .. shell.stringify_data(function(args)
375375
-- Only set the layout if preview isn't hidden
376376
if not tonumber(args[1]) then return end
377-
return string.format("change-preview-window(%s)", fzf_win:fzf_preview_layout_str())
377+
-- NOTE: do not use local ref `fzf_win` as it my change on resume (#2255)
378+
local winobj = utils.fzf_winobj()
379+
if not winobj then return end
380+
return string.format("change-preview-window(%s)", winobj:fzf_preview_layout_str())
378381
end, opts, utils.__IS_WINDOWS and "%FZF_PREVIEW_LINES%" or "$FZF_PREVIEW_LINES")))
379382
end
380383

0 commit comments

Comments
 (0)