summaryrefslogtreecommitdiff
path: root/script-beta/await.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-30 17:08:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-30 17:08:03 +0800
commit40135e7d6bb96e34aafd133b24cdff2e73d1a892 (patch)
tree2c4d08901db0d574c089a47580d78854becf7140 /script-beta/await.lua
parentb964c31fb2e9aba9e29c19218ba75538e2ce19fd (diff)
downloadlua-language-server-40135e7d6bb96e34aafd133b24cdff2e73d1a892.zip
修正会遍历2次文件的bug
Diffstat (limited to 'script-beta/await.lua')
-rw-r--r--script-beta/await.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script-beta/await.lua b/script-beta/await.lua
index a26adff8..a718dbb6 100644
--- a/script-beta/await.lua
+++ b/script-beta/await.lua
@@ -100,6 +100,9 @@ function m.sleep(time)
end
local co = coroutine.running()
timer.wait(time, function ()
+ if coroutine.status(co) == 'dead' then
+ return
+ end
return m.checkResult(co, coroutine.resume(co))
end)
return coroutine.yield()