From d24d1eb018787ccdff681e8d5baa33e13e036888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 17 Jun 2021 20:40:48 +0800 Subject: improve --- script/files.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/files.lua b/script/files.lua index a653b364..517cd03d 100644 --- a/script/files.lua +++ b/script/files.lua @@ -186,12 +186,20 @@ function m.setText(uri, text, isTrust) if create then m.onWatch('create', originUri) end - m.onWatch('update', originUri) if DEVELOP then if text ~= newText then util.saveFile(LOGPATH .. '/diffed.lua', newText) end end + + await.call(function () + await.close('update:' .. originUri) + await.setID('update:' .. originUri) + await.delay() + if m.exists(originUri) then + m.onWatch('update', originUri) + end + end) end function m.setRawText(uri, text) -- cgit v1.2.3