Skip to content

Commit

Permalink
fix: use nio.scheduler to avoid double wrap
Browse files Browse the repository at this point in the history
Co-authored-by: vhyrro <76052559+vhyrro@users.noreply.github.com>
  • Loading branch information
benlubas and vhyrro committed May 18, 2024
1 parent acd4293 commit 2a9c3fa
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions lua/neorg/modules/core/latex/renderer/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,16 @@ local function render_latex()
render_timer = nil

if not running_proc then
vim.schedule(function()
running_proc = nio.run(
function()
module.public.async_latex_renderer(buf)
end,
vim.schedule_wrap(function()
module.public.render_inline_math(module.private.latex_images[buf] or {}, buf)
running_proc = nil
end)
)
end)
running_proc = nio.run(
function()
nio.scheduler()
module.public.async_latex_renderer(buf)
end,
function()
module.public.render_inline_math(module.private.latex_images[buf] or {}, buf)
running_proc = nil
end
)
end
end)
end
Expand Down

0 comments on commit 2a9c3fa

Please sign in to comment.