summaryrefslogtreecommitdiff
path: root/script/workspace/require-path.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/workspace/require-path.lua')
-rw-r--r--script/workspace/require-path.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua
index 1b7b25f9..1e7c81e5 100644
--- a/script/workspace/require-path.lua
+++ b/script/workspace/require-path.lua
@@ -179,21 +179,21 @@ function mt:findUrisByRequireName(suri, name)
searcherMap[fullUri] = searcher
end
end
- if not strict then
- local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '')
- for uri in files.eachFile(self.scp.uri) do
- if not searcherMap[uri]
- and suri ~= uri
- and util.stringEndWith(uri, tail) then
- results[#results+1] = uri
- local parentUri = files.getLibraryUri(self.scp.uri, uri) or self.scp.uri
- if parentUri == nil or parentUri == '' then
- parentUri = furi.encode ''
- end
- local relative = uri:sub(#parentUri + 1):sub(1, - #tail)
- searcherMap[uri] = workspace.normalize(relative .. searcher)
- end
- end
+ local tail = '/' .. furi.encode(fspath):gsub('^file:[/]*', '')
+ for uri in files.eachFile(self.scp.uri) do
+ if not searcherMap[uri]
+ and suri ~= uri
+ and util.stringEndWith(uri, tail) then
+ local parentUri = files.getLibraryUri(self.scp.uri, uri) or self.scp.uri
+ if parentUri == nil or parentUri == '' then
+ parentUri = furi.encode ''
+ end
+ local relative = uri:sub(#parentUri + 1):sub(1, - #tail)
+ if not strict or relative == "/" then
+ results[#results+1] = uri
+ end
+ searcherMap[uri] = workspace.normalize(relative .. searcher)
+ end
end
end