From e76dd6108712200905e05edef73f6e71bcab40ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 25 Mar 2019 12:42:53 +0800 Subject: =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E8=87=AA=E5=8A=A8=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E6=B7=BB=E5=8A=A0=E5=8F=AF=E8=A7=81=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/completion.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/src/core/completion.lua') diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 67b03213..54f96295 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -250,8 +250,9 @@ local function searchCloseGlobal(vm, source, word, callback) end local close = loc:close() -- 因为闭包的关系落在局部变量finish到close范围内的全局变量一定能访问到该局部变量 + for _, src in ipairs(vm.sources) do - if src:get 'global' + if (src:get 'global' or src:bindLocal()) and src.start >= source.finish and src.finish <= close then -- cgit v1.2.3