Skip to content

Commit

Permalink
fix(awesome_colorschemes): stack overflow (closes #1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Aug 12, 2024
1 parent f59bc2c commit 4e861e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/fzf-lua/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ end
---@return thread
M.fzf_wrap = function(opts, contents, fn_selected)
opts = opts or {}
local _co
coroutine.wrap(function()
opts._co = coroutine.running()
if type(opts.cb_co) == "function" then opts.cb_co(opts._co) end
_co = coroutine.running()
if type(opts.cb_co) == "function" then opts.cb_co(_co) end
opts.fn_selected = opts.fn_selected or fn_selected
local selected = M.fzf(contents, opts)
if opts.fn_selected then
Expand All @@ -240,7 +241,7 @@ M.fzf_wrap = function(opts, contents, fn_selected)
end)
end
end)()
return opts._co
return _co
end

-- conditionally update the context if fzf-lua
Expand Down

0 comments on commit 4e861e4

Please sign in to comment.