mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Allow running in a sync call
This commit is contained in:
parent
53525b511e
commit
b18fdc811b
1 changed files with 4 additions and 0 deletions
|
|
@ -29,6 +29,10 @@ function ya.flat(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ya.sync(f)
|
function ya.sync(f)
|
||||||
|
if ya.SYNC_ON then
|
||||||
|
return function(...) f(...) end
|
||||||
|
end
|
||||||
|
|
||||||
YAZI_SYNC_BLOCKS = YAZI_SYNC_BLOCKS + 1
|
YAZI_SYNC_BLOCKS = YAZI_SYNC_BLOCKS + 1
|
||||||
if YAZI_SYNC_CALLS == YAZI_SYNC_BLOCKS then
|
if YAZI_SYNC_CALLS == YAZI_SYNC_BLOCKS then
|
||||||
YAZI_SYNC_ENTRY = f
|
YAZI_SYNC_ENTRY = f
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue