From 599065480e33e21e66d307b06e8f8deae101756e 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, 11 Apr 2022 17:02:42 +0800 Subject: fix #1034 don't require self --- script/workspace/require-path.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'script/workspace/require-path.lua') diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 56c94424..ca4a0e98 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -123,12 +123,14 @@ function m.findUrisByRequirePath(suri, path) local clt = scope.getScope(suri):get('requireName') if clt then for _, uri in clt:each(suri, fspath) do - local infos = m.getVisiblePath(suri, furi.decode(uri)) - for _, info in ipairs(infos) do - local fsexpect = info.expect:gsub('%' .. separator, '/') - if fsexpect == fspath then - results[#results+1] = uri - searchers[uri] = info.searcher + if uri ~= suri then + local infos = m.getVisiblePath(suri, furi.decode(uri)) + for _, info in ipairs(infos) do + local fsexpect = info.expect:gsub('%' .. separator, '/') + if fsexpect == fspath then + results[#results+1] = uri + searchers[uri] = info.searcher + end end end end -- cgit v1.2.3