Allow running in a sync call

This commit is contained in:
Diogo Duarte 2024-02-20 08:50:59 +00:00
parent 53525b511e
commit b18fdc811b

View file

@ -29,6 +29,10 @@ function ya.flat(t)
end
function ya.sync(f)
if ya.SYNC_ON then
return function(...) f(...) end
end
YAZI_SYNC_BLOCKS = YAZI_SYNC_BLOCKS + 1
if YAZI_SYNC_CALLS == YAZI_SYNC_BLOCKS then
YAZI_SYNC_ENTRY = f