mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: allow running ya.sync in a sync plugin call (#702)
This commit is contained in:
parent
2e9b6b7b7b
commit
ed22be731a
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue