prevent (and alert on) multiple instances of fzf-lua

main
bhagwan 3 years ago
parent 2cd88dc855
commit 2dd5046455

@ -10,6 +10,7 @@ local M = {}
M.fzf = function(opts, contents)
-- setup the fzf window and preview layout
local fzf_win = win(opts)
if not fzf_win then return end
-- instantiate the previewer
-- if not opts.preview and not previewer and
local previewer, preview_opts = nil, nil

@ -171,6 +171,10 @@ function FzfWin:reset_win_highlights(win, is_border)
end
function FzfWin:new(o)
if _self then
utils.warn("Please close fzf-lua before starting a new instance")
return nil
end
o = o or {}
self = setmetatable({}, { __index = self })
self.winopts = normalize_winopts(o)

Loading…
Cancel
Save